summaryrefslogtreecommitdiff
path: root/source3/smbd
AgeCommit message (Collapse)AuthorFilesLines
2013-07-11smbd: Fix a 100% loop at shutdown timeVolker Lendecke1-2/+5
In the destructor of fsp->aio_requests[0] we put another request into fsp->aio_requests[0]. Don't overwrite that with TALLOC_FREE. 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): Thu Jul 11 20:56:42 CEST 2013 on sn-devel-104
2013-07-09smbd: Fix a profile problemVolker Lendecke5-27/+34
When trying to read a profile, under certain circumstances Windows tries to read with its machine account first. The profile previously written was stored with an ACL that only allows access for the user and not the machine. Windows should get an NT_STATUS_ACCESS_DENIED when using the machine account, making it retry with the user account (which would then succeed). Samba under these circumstances erroneously gives NT_STATUS_OBJECT_PATH_NOT_FOUND, which makes Windows give up and not retry. The reasons is the "dropbox" patch in unix_convert, turning EACCESS on the last path component to OBJECT_PATH_NOT_FOUND. This patch makes the dropbox behaviour only kick in when we are creating a file. I think this is an abstraction violation. unix_convert() should not have to know about the create_disposition, but given that we have pathname resolution separated from the core open code right now this is the best we can do. Signed-off-by: Volker Lendecke <Volker.Lendecke@SerNet.DE> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-06-25s3:smbd/close remove filesystem lock before removing sharemodeChristian Ambach1-0/+9
otherwise we are open for a race condition: opener 1 opens file and closes it - during the close, the share mode entry will be removed from locking.tdb, but share mode in the file system will be dropped later after delete_on_close and write time updates have been done opener 2 requests open of same file with file overwrite - locking.tdb does not list original entry, but file system share mode is still around - VFS_FTRUNCATE will fail and error was converted to STATUS_ACCESS_DENIED Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Christian Ambach <ambi@samba.org> Autobuild-Date(master): Tue Jun 25 14:48:44 CEST 2013 on sn-devel-104
2013-06-25s3:smbd/close use common exit pathChristian Ambach1-9/+2
do not return early here, but use the common exit path that will remove the share mode from the record Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-06-25s3:smbd/aio mark file as modified in the SMB2 caseChristian Ambach1-0/+2
Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-06-20Fix bug #9166 - Starting smbd or nmbd with stdin from /dev/null results in ↵Jeremy Allison1-1/+13
"EOF on stdin" Only install the stdin handler if it's a pipe or fifo. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-06-12smbd: Remove an unused variableVolker Lendecke1-2/+0
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): Wed Jun 12 01:00:44 CEST 2013 on sn-devel-104
2013-06-11smbd: Fix a const warningVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-06-11smbd: Fix a const warningVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-06-11smbd: Remove unused codeVolker Lendecke1-7/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-06-06smbd: Change logging when SET_OFFLINE is not supportedChristof Schmitt1-10/+15
A client can send a request to set the OFFLINE attribute. In the default code this is not supported and triggers a log message each time. Change this to only log with level 0 when an actual errors occurs, and log ENOTSUP with level 10. Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Jun 6 04:30:26 CEST 2013 on sn-devel-104
2013-06-04s3:smbd: explain parameters in call to SMB_VFS_DURABLE_RECONNECT()Michael Adam1-2/+3
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): Tue Jun 4 21:58:16 CEST 2013 on sn-devel-104
2013-06-04s3:smbd: remove code duplication in smb2_create_send()Michael Adam1-51/+25
Move the calls to smb2srv_open_recreate() from the parsing of the create blobs (DHNC and DH2C) to a central place in the open execution phase. This is also where it should be called: in the durable reconnect part, right before the call to SMB_VFS_DURABLE_RECONNECT() Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-06-04s3:smbd: remove old comment about scavenger timer from ↵Michael Adam1-14/+0
vfs_default_durable_reconnect() scavenger functionality belongs to the smb layer (and is meanwhile implemented there). Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-06-03Fix bug 9900: is_printer_published GUID retrievalDavid Disseldorp1-1/+1
Samba currently always responds to GetPrinter(level = 7) requests with DSPRINT_UNPUBLISH, regardless of the AD publish status tracked via the PRINTER_ATTRIBUTE_PUBLISHED flag. This is due to erroneous "objectGUID" unmarshalling in is_printer_published(). This change splits "objectGUID" retrieval into a separate function, and adds a pull_reg_sz() call to correctly unmarshall the GUID. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2013-05-27smbd: Fix build on platforms that will not support var = {} initialisationAndrew Bartlett1-1/+4
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2013-05-23Revert my accidental commit.Richard Sharpe1-1/+1
Signed-off-by: Richard Sharpe <rsharpe@samba.org> Autobuild-User(master): Richard Sharpe <sharpe@samba.org> Autobuild-Date(master): Thu May 23 06:53:17 CEST 2013 on sn-devel-104
2013-05-21Make sure that if an smbd is exiting because of an error we let the user know.Richard Sharpe1-1/+1
Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com>
2013-05-14smbd: Remove a pointless variableVolker Lendecke1-2/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue May 14 13:19:44 CEST 2013 on sn-devel-104
2013-05-07Remove the compound_related_in_progress state from the smb2 global state.Jeremy Allison2-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>
2013-05-07The core of the fix to allow opens to go async inside a compound request.Jeremy Allison1-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>
2013-05-07Move a variable into the area of code where it's used.Jeremy Allison1-2/+2
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
2013-05-07Ensure we don't try and cancel anything that is in a compound-related request.Jeremy Allison1-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>
2013-05-07Only do the 1 second delay for sharing violations for SMB1, not SMB2.Jeremy Allison1-1/+2
Match Windows behavior. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
2013-05-06Allow "store dos attributes" to override the other "map XXX" parameters.Jeremy Allison1-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>
2013-04-30check_parent_exists() can change errno. Ensure we preserve it across calls.Anand Avati1-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
2013-04-27Fix bug #9822 - Samba crashing during Win8 sync.Jeremy Allison1-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
2013-04-27Check for WRITE_ACCESS on the file before overriding an EACCESS.Jeremy Allison1-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
2013-04-27Ensure we don't try the open_file_fchmod() if we can't write to the file.Jeremy Allison1-0/+5
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-04-27Remove indentation around code wrapped by unneeded CAN_WRITE.Jeremy Allison1-23/+20
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-04-27Add early return in file_set_dosmode() on a read only share.Jeremy Allison1-0/+5
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-04-27smbd: Do not fetch the record in defer_open_doneVolker Lendecke1-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
2013-04-26smbd: We don't use DEFERRED_OPEN_ENTRY anymoreVolker Lendecke4-152/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-26smbd: Remove unused smb2_deferred_open_timerVolker Lendecke1-59/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-26smbd: Obsolete MSG_SMB_OPEN_RETRYVolker Lendecke2-45/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-26smbd: Remove the unused fsp->pending_break_messages arrayVolker Lendecke2-15/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-26smbd: Remove unused reply_to_oplock_break_requestsVolker Lendecke5-27/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-26smbd: Obsolete MSG_SMB_BREAK_RESPONSEVolker Lendecke1-62/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-26smbd: Ignore OPEN_RETRY and BREAK_RESPONSEVolker Lendecke3-0/+8
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-26smbd: Use dbwrap_record_watch_send for defer_openVolker Lendecke1-1/+67
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-20Fix bug in old create temp SMB request. Only use VFS functions.Jeremy Allison1-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
2013-04-20Ensure the RECVFILE path in vfs_pwrite_data() operates on a blocking socket.Jeremy Allison1-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
2013-04-19Ensure the RECVFILE path in vfs_write_data() operates on a blocking socket.Jeremy Allison1-1/+12
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
2013-04-19Add the internals of is_smb2_recvfile_write.Jeremy Allison1-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>
2013-04-19The guts of the receivefile code changes.Jeremy Allison1-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>
2013-04-19Add stub static function that will turn on/off receivefile code path.Jeremy Allison1-0/+5
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
2013-04-19Add extra fields into struct smbd_smb2_request_read_state to support ↵Jeremy Allison1-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>
2013-04-19Add macro SMBD_SMB2_SHORT_RECEIVEFILE_WRITE_LEN.Jeremy Allison1-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>
2013-04-19Add utility function get_min_receive_file_size().Jeremy Allison1-0/+11
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
2013-04-19Allow smbd_smb2_request_error_ex() to cope with unread bytes on error.Jeremy Allison1-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>