summaryrefslogtreecommitdiffstats
path: root/source3/smbd
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove the compound_related_in_progress state from the smb2 global state.Jeremy Allison2013-05-072-12/+0
| | | | | | | | And also remove the restriction that we can't read a new request whilst we're in this state. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@samba.org>
* The core of the fix to allow opens to go async inside a compound request.Jeremy Allison2013-05-071-43/+53
| | | | | | | | This is only allowed for opens that cause an oplock break, otherwise it is not allowed. See [MS-SMB2].pdf note <194> on Section 3.3.5.2.7. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* Move a variable into the area of code where it's used.Jeremy Allison2013-05-071-2/+2
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* Ensure we don't try and cancel anything that is in a compound-related request.Jeremy Allison2013-05-071-0/+8
| | | | | | | Too hard to deal with splitting off the replies. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* Only do the 1 second delay for sharing violations for SMB1, not SMB2.Jeremy Allison2013-05-071-1/+2
| | | | | | | Match Windows behavior. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* Allow "store dos attributes" to override the other "map XXX" parameters.Jeremy Allison2013-05-061-5/+8
| | | | | | | | Makes us consistent with what is described in the man pages. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* check_parent_exists() can change errno. Ensure we preserve it across calls.Anand Avati2013-04-301-1/+8
| | | | | | | | Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Apr 30 11:00:11 CEST 2013 on sn-devel-104
* Fix bug #9822 - Samba crashing during Win8 sync.Jeremy Allison2013-04-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | When refactoring the dptr desctructor in the fix for bug: 9778 (Samba directory code uses dirfd() without vectoring through a VFS call) I removed the code to NULL out the struct smb_Dir * pointer inside the fsp struct by mistake. Re-add the NULLing out of that pointer when closing a directory pointer associated with an open file. Reporter confirms it fixes the crash. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Sat Apr 27 20:44:55 CEST 2013 on sn-devel-104
* Check for WRITE_ACCESS on the file before overriding an EACCESS.Jeremy Allison2013-04-271-0/+4
| | | | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Sat Apr 27 15:57:17 CEST 2013 on sn-devel-104
* Ensure we don't try the open_file_fchmod() if we can't write to the file.Jeremy Allison2013-04-271-0/+5
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* Remove indentation around code wrapped by unneeded CAN_WRITE.Jeremy Allison2013-04-271-23/+20
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* Add early return in file_set_dosmode() on a read only share.Jeremy Allison2013-04-271-0/+5
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* smbd: Do not fetch the record in defer_open_doneVolker Lendecke2013-04-271-8/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Apr 27 02:06:10 CEST 2013 on sn-devel-104
* smbd: We don't use DEFERRED_OPEN_ENTRY anymoreVolker Lendecke2013-04-264-152/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Remove unused smb2_deferred_open_timerVolker Lendecke2013-04-261-59/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Obsolete MSG_SMB_OPEN_RETRYVolker Lendecke2013-04-262-45/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Remove the unused fsp->pending_break_messages arrayVolker Lendecke2013-04-262-15/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Remove unused reply_to_oplock_break_requestsVolker Lendecke2013-04-265-27/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Obsolete MSG_SMB_BREAK_RESPONSEVolker Lendecke2013-04-261-62/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Ignore OPEN_RETRY and BREAK_RESPONSEVolker Lendecke2013-04-263-0/+8
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use dbwrap_record_watch_send for defer_openVolker Lendecke2013-04-261-1/+67
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Fix bug in old create temp SMB request. Only use VFS functions.Jeremy Allison2013-04-201-53/+64
| | | | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Sat Apr 20 21:13:36 CEST 2013 on sn-devel-104
* Ensure the RECVFILE path in vfs_pwrite_data() operates on a blocking socket.Jeremy Allison2013-04-201-1/+12
| | | | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Apr 20 01:04:05 CEST 2013 on sn-devel-104
* Ensure the RECVFILE path in vfs_write_data() operates on a blocking socket.Jeremy Allison2013-04-191-1/+12
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
* Add the internals of is_smb2_recvfile_write.Jeremy Allison2013-04-191-1/+37
| | | | | | | | This turns on the real receivefile detection, and completes the receivefile code path changes. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
* The guts of the receivefile code changes.Jeremy Allison2013-04-191-5/+60
| | | | | | | | | | | | | | | | If an incoming PDU might qualify, only read SMBD_SMB2_SHORT_RECEIVEFILE_WRITE_LEN = (SMB2_HEADER + SMB2_WRITE_BODY_LEN) bytes rather than the whole PDU. Next time we're called, use is_smb2_recvfile_write() to decide if this is an SMB2_WRITE that fit the receivefile criteria, otherwise just read the rest of the PDU. If we did do a short receivefile read, set up the smb2_req->smb1req->unread_bytes value to show what bytes remain in the TCP buffers. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
* Add stub static function that will turn on/off receivefile code path.Jeremy Allison2013-04-191-0/+5
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
* Add extra fields into struct smbd_smb2_request_read_state to support ↵Jeremy Allison2013-04-191-0/+3
| | | | | | | | | | receivefile. Initialize min_recv_size with the size that will trigger the receivefile write path. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
* Add macro SMBD_SMB2_SHORT_RECEIVEFILE_WRITE_LEN.Jeremy Allison2013-04-191-0/+2
| | | | | | | | This is the 'short' length we'll read in the SMB2_WRITE receivefile code path. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
* Add utility function get_min_receive_file_size().Jeremy Allison2013-04-191-0/+11
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
* Allow smbd_smb2_request_error_ex() to cope with unread bytes on error.Jeremy Allison2013-04-191-0/+10
| | | | | | | Drain the socket if a RECVFILE write failed. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
* Add function smbd_smb2_unread_bytes().Jeremy Allison2013-04-192-0/+13
| | | | | | | | Returns number of bytes left to read for recvfile. Will be used in SMB_2_WRITE_FILE code path. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
* If we already have an smb1req attached to the struct smbd_smb2_request, ↵Jeremy Allison2013-04-191-3/+7
| | | | | | | don't recreate it. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
* Ensure we don't do an SMB2 aio write if RECVFILE is active.Jeremy Allison2013-04-191-0/+5
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
* fileserver: raise the debug level for share connection from non IPC to 2Matthieu Patou2013-04-191-1/+1
| | | | | | | | So that logs of make test are not spamed, the code dates from 1999 maybe at that moment we wanted to have some warning I think nodays it's pretty stable. Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd stop working on a dead client socketChristian Ambach2013-04-191-0/+1
| | | | | | | | when the client has already disconnected, exit server as done in other paths in smbd_process Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3:smbd increase a loglevelChristian Ambach2013-04-191-5/+5
| | | | | | | do not complain too loudly if the socket has already gone Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* smbd: Fix signing when the async echo handler kicks inVolker Lendecke2013-04-191-1/+1
| | | | | | | This was introduced as a copy&paste error in 5e0258fc932c Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org>
* s3:smbd:smb2:scavenger: fix format error for debugging open_persistent_id in ↵Michael Adam2013-04-191-4/+5
| | | | | | | | | | scavenger_timer() Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Apr 19 01:36:15 CEST 2013 on sn-devel-104
* s3:smbd: call scavenger_schedule_disconnected() from close normal file for ↵Gregor Beck2013-04-181-0/+2
| | | | | | | | durable handles Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:smbd: add a scavenger process for disconnected durable handlesGregor Beck2013-04-183-0/+567
| | | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Gregor Beck <gbeck@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbXsrv_open: add function smbXsrv_open_cleanup()Gregor Beck2013-04-182-0/+80
| | | | | | Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:smbXsrv_open: factor out smbXsrv_open_global_parse_recordGregor Beck2013-04-181-14/+36
| | | | | | Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:smbd:smb2: fix setting of scavenge timeout when reconnecting durable handlesMichael Adam2013-04-181-5/+4
| | | | | | | | | | | The bug fixed with this commit led to reconnected durable handles having a disconnect timeout of 0 msec. This fix re-establishes the original timeout for the reconnected handle. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org>
* smbd: Convert create_file_unixpath to synthetic_smb_fnameVolker Lendecke2013-04-171-5/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Convert is_visible_file to synthetic_smb_fnameVolker Lendecke2013-04-171-4/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Convert dptr_create to synthetic_smb_fnameVolker Lendecke2013-04-171-8/+7
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Convert set_create_timespec_ea to synthetic_smb_fnameVolker Lendecke2013-04-171-8/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Convert unix_mode to synthetic_smb_fnameVolker Lendecke2013-04-171-8/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Convert rmdir_internals to synthetic_smb_fnameVolker Lendecke2013-04-171-7/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>