summaryrefslogtreecommitdiffstats
path: root/source/smbd/reply.c
Commit message (Collapse)AuthorAgeFilesLines
* Write times code update.Jeremy Allison2008-09-051-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ok, here's the fix for the write times breakage with the new tests in S4 smbtorture. The key is keeping in the share mode struct the "old_file_time" as the real write time, set by all the write and allocation calls, and the "changed_write_time" as the "sticky" write time - set by the SET_FILE_TIME calls. We can set them independently (although I kept the optimization of not setting the "old_file_time" is a "changed_write_time" was already set, as we'll never see it. This allows us to update the write time immediately on the SMBwrite truncate case, SET_END_OF_FILE and SET_ALLOCATION_SIZE calls, whilst still have the 2 second delay on the "normal" SMBwrite, SMBwriteX calls. I think in a subsequent patch I'd like to change the name of these from "old_file_time" to "write_time" and "changed_write_time" to "sticky_write_time" to make this clearer. I think I also fixed a bug in Metze's original code in that once a write timestamp had been set from a "normal" SMBwriteX call the fsp->update_write_time_triggered variable was set and then never reset - thus meaning the write timestamp would never get updated again on subsequent SMBwriteX's. The new code checks the update_write_time_event event instead, and doesn't update is there's an event already scheduled. Metze especially, please check this over for your understanding. Jeremy.
* Slightly simplify logic: remove an else branchVolker Lendecke2008-09-011-14/+11
|
* Add st_birthtime and friends for accurate create times on systems that ↵Jeremy Allison2008-08-271-3/+4
| | | | | | | support it (*BSD and MacOSX). Should have done this ages ago, sorry. Jeremy.
* EINVAL is also a valid error return, meaning "this filesystemAndrew Tridgell2008-08-261-2/+3
| | | | cannot do sendfile for this file"
* Fix for bug #5617, reported and patched by Bartosz Antosik antosik@gmail.com.Jeremy Allison2008-08-141-0/+2
| | | | | | xp/2003 explorer freezes browsing shares on samba ipv6 hosts. Caused by missing reply packet to SMB printclose packet. Jeremy
* I found lots of places where we assume error will be set when callingAndrew Tridgell2008-08-121-2/+2
| | | | | | | | | | | | | | | one of our virtualised functions, such as db_open(), but error is only set when a system call fails, and it is not uncommon for us to fail a function internally without ever making a system call. That led to us passing back success when a function had in fact failed. I found two places where we relied on map_nt_error_from_unix() returning success when errno==0, but lots and lots of places where we relied on the reverse, so I fixed those two places. map_nt_error_from_unix() will now always return an error, returning NT_STATUS_UNSUCCESSFUL if errno is 0 (cherry picked from commit 69d40ca4c1af925d4b0e59ddc69ef8c26e6501d1)
* Fix a debug messageVolker Lendecke2008-07-271-1/+1
|
* Remove a pointless CONST_DISCARDVolker Lendecke2008-07-271-1/+1
|
* Fix bug creating files using DOS clients with mixedJeremy Allison2008-07-251-1/+1
| | | | | | | | | case files. Reported by Daniel Johnson <Progman2000@usa.net>. The smb_set_file_time() call to set the filetimes is failing because it's using the unmodified name passed in by the client, not the modified name (matching case on the disk) that comes out from create_file(). Jeremy.
* Remove current_user reference from printfsp.cVolker Lendecke2008-06-261-1/+1
|
* Remove current_user references from trans2.cVolker Lendecke2008-06-191-0/+31
| | | | This involved replacing the CHECK_NTQUOTA_HANDLE_OK macro by a function.
* Remove reference to current_user from reply.cVolker Lendecke2008-06-191-4/+3
|
* Remove the "current_user" arg from fsp_belongs_connVolker Lendecke2008-06-191-2/+2
| | | | | fsp_belongs_conn only used the vuid struct member anyway, and this is available in the smb_request structure as well.
* Remove the "current_user" arg from check_fspVolker Lendecke2008-06-191-19/+19
| | | | | check_fsp only used the vuid struct member anyway, and this is available in the smb_request structure as well.
* Fix the build of reply_setattrE().Günther Deschner2008-04-081-2/+2
| | | | | | How ever could this compile ? Guenther
* smbd: make it possible to disable get_file_infos() on searchesStefan Metzmacher2008-04-071-2/+11
| | | | metze
* smbd: implement the strange write time update logicStefan Metzmacher2008-04-071-22/+39
| | | | | | | | | | | | | | | | | | | | We now never call file_ntimes() directly, every update is done via smb_set_file_time(). This let samba3 pass the BASE-DELAYWRITE test. The write time is only updated 2 seconds after the first write() on any open handle to the current time (not the time of the first write). Each handle which had write requests updates the write time to the current time on close(). If the write time is set explicit via setfileinfo or setpathinfo the write time is visible directly and a following close on the same handle doesn't update the write time. metze
* locking: store the write time in the locking.tdbStefan Metzmacher2008-04-071-1/+2
| | | | | | | | | This is needed to implement the strange write time update logic later. We need to store 2 time timestamps to distinguish between the time the file system had before the first client opened the file and a forced timestamp update. metze
* Fix missing '&&'.Jeremy Allison2008-03-281-1/+1
| | | | Jeremy.
* Only allow sendfile on non-stream fsp's. Should fix make test for streamsJeremy Allison2008-03-281-2/+2
| | | | | as sendfile isn't implemented in the streams vfs modules yet. Jeremy.
* printclose has only 1 vwvVolker Lendecke2008-03-281-1/+1
|
* Allow us to pass RAW-RENAME by testing that the connection structJeremy Allison2008-03-111-1/+1
| | | | | connection paths are equal, not just the conn structs themselves. Jeremy.
* Try and fix bug #5315, as well as S4 torture tests RAW-OPLOCK BATCH19,Jeremy Allison2008-03-111-7/+8
| | | | | BATCH20 and RAW-RENAME. Jeremy.
* Don't use fname after create_file has been calledVolker Lendecke2008-02-221-11/+11
| | | | | | | | create_file calls unix_convert internally, so modifies fname. So we can't use "fname" after create_file has returned. Use fsp->fsp_name instead. Found during a lengthy debugging session with Karolin testing the xattr_tdb module...
* Fix some typos.Karolin Seeger2008-02-081-1/+1
| | | | Karolin
* Change the file time before we change the file mode.Alexander Bokovoy2008-02-061-6/+6
| | | | | | This doesn't matter for most applications, but for offline files it matters as it allows you to set files offline from windows clients even with HSM systems that refuse to offline newly created files. Merge from Tridge's v3-0-ctdb tree.
* Convert read_data() to NTSTATUSVolker Lendecke2008-02-021-4/+5
|
* Make get_srv_read_error static to process.cVolker Lendecke2008-02-021-2/+2
|
* Convert read_smb_length to return NTSTATUSVolker Lendecke2008-02-021-9/+3
|
* Re-enable async I/O for non-TSM systemsVolker Lendecke2008-01-301-9/+2
| | | | | | | The logic was wrong: A "SMB_VFS_AIO_FORCE()==False" disabled async I/O, whereas a "SMB_VFS_AIO_FORCE()==True" should enforce it regardless of other settings. Alexander, please check!
* Fix some "set but never used" warningsVolker Lendecke2008-01-201-3/+1
|
* Don't test split_ntfs_stream_nameVolker Lendecke2008-01-201-3/+0
| | | | | This is a hot code path, and if it has a :, the name will be split later on anyway.
* Add streams supportVolker Lendecke2008-01-191-8/+20
| | | | | | | | | | This is the core of the streams support. The main change is that in files_struct there is now a base_fsp pointer that holds the main file open while a stream is open. This is necessary to get the rather strange delete semantics right: You can't delete the main file while a stream is open without FILE_SHARE_DELETE, and while a stream is open a successful unlink of the main file leads to DELETE_PENDING for all further access on the main file or any stream.
* Add support for offline files support, remote storage, and Async I/O force ↵Alexander Bokovoy2008-01-161-6/+13
| | | | | | | | | | | | | | | | operations to VFS Offline files support and remote storage are for allowing communication with backup and archiving tools that mark files moved to a tape library as offline. We translate this info into corresponding CIFS offline file attribute and mark an exported volume as remote storage. Async I/O force is to allow selective redirection of I/O operations to asynchronous processing in case it is viable at VFS module discretion. It is needed for proper handling of offline files as performing regular I/O on offline file will block smbd. Signed-off-by: Alexander Bokovoy <ab@samba.org>
* Convert OpenDir to talloc, use talloc_tos()Volker Lendecke2008-01-121-16/+19
| | | | This cuts some mallocs on NtCreate&X
* Combine fsp and fromfd to fromfsp in SMB_VFS_SENDFILE().Michael Adam2008-01-111-2/+2
| | | | Michael
* use talloc_tos in a few more placesVolker Lendecke2008-01-101-3/+5
|
* Fix resource leak found by coverity (CID 521).Jeremy Allison2008-01-081-0/+4
| | | | Jeremy.
* Remove redundant parameter fd from SMB_VFS_FSTAT().Michael Adam2008-01-071-4/+4
| | | | Michael
* Remove redundant parameter fd from SMB_VFS_LSEEK().Michael Adam2008-01-071-3/+3
| | | | Michael
* Now conn is part of smb_request, we don't need it asJeremy Allison2008-01-041-59/+88
| | | | | | an extra parameter. This cleans up quite a few places we were passing it around without needing it. Jeremy.
* Refactor the crypto code after a very helpful conversationJeremy Allison2008-01-041-26/+29
| | | | | | with Volker. Mostly making sure we have data on the incoming packet type, not stored in the smb header. Jeremy.
* Convert reply_mknew to create_fileVolker Lendecke2008-01-021-38/+16
|
* Convert reply_open_and_X to create_fileVolker Lendecke2008-01-021-42/+19
|
* Convert reply_open to create_fileVolker Lendecke2008-01-021-40/+19
|
* Add SMB encryption. Still fixing client decrypt butJeremy Allison2007-12-261-12/+23
| | | | | negotiation works. Jeremy.
* Some C++ warningsVolker Lendecke2007-12-211-2/+2
|
* Constrain "min receivefile size" to max of BUFFER_SIZEJeremy Allison2007-11-071-2/+20
| | | | | | | (128k). Add debug error messages so we can see why writeX large is denied. Ensure we don't allow recvfile writes on IPC$. Jeremy.
* Remove the horror that was the global smb_rw_error.Jeremy Allison2007-11-051-2/+3
| | | | | | | | | | Each cli struct has it's own local copy of this variable, so use that in client code. In the smbd server, add one static to smbd/proccess.c and use that inside smbd. Fix a bunch of places where smb_rw_error could be set by calling read_data() in places where we weren't reading from the SMB client socket (ie. winbindd). Jeremy.
* Change the client library to write directly out ofJeremy Allison2007-11-021-5/+10
| | | | | | | the incoming buffer in the non-signed case. Speeds up writes by over 10% or so. Complete the server recvfile implementation. Jeremy.