summaryrefslogtreecommitdiffstats
path: root/source3/smbd
Commit message (Collapse)AuthorAgeFilesLines
...
* smbd: Simplify dropbox special case in unix_convertVolker Lendecke2013-08-261-6/+23
| | | | | | | | | | | | | | | | EACCESS needs special treatment: If we want to create a fresh file, return OBJECT_PATH_NOT_FOUND, so that the client will continue creating the file. If the client wants us to open a potentially existing file, we need to correctly return ACCESS_DENIED. This patch makes this behaviour hopefully a bit clearer than the code before did. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Aug 26 12:14:26 CEST 2013 on sn-devel-104
* Revert "Fix the erroneous masking of chmod requests via the UNIX extensions."Jeremy Allison2013-08-251-2/+7
| | | | | | | | | | | | Pushed from the wrong branch - this is the version without Simo's review changes. Apologies to all and I'll re-submit in less of a haste after the weekend. This reverts commit f124d6fbcd0a03bbd95d69477c144f475546de66. Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sun Aug 25 05:44:11 CEST 2013 on sn-devel-104
* Revert "Allow UNIX extensions client to act on open fsp instead of pathname ↵Jeremy Allison2013-08-241-8/+1
| | | | | | | | | | | if available." Pushed from the wrong branch - this is the version without Simo's review changes. Apologies to all and I'll re-submit in less of a haste after the weekend. This reverts commit ce776551abb07f18cf302ee7c0c437ee27952099.
* Pushed from the wrong branch - this is the versionJeremy Allison2013-08-241-14/+6
| | | | | | | | | | without Simo's review changes. Apologies to all and I'll re-submit in less of a haste after the weekend. Revert "Fix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN." This reverts commit cf86adc4419f2636a0b24824ab04ebfcd5bb074d.
* Fix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN.Jeremy Allison2013-08-251-6/+14
| | | | | | | | | UNIX calls never deref links. Signed-off-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sun Aug 25 01:02:40 CEST 2013 on sn-devel-104
* Allow UNIX extensions client to act on open fsp instead of pathname if ↵Jeremy Allison2013-08-241-1/+8
| | | | | | | | available. Eliminates possible race condition on pathname op. Signed-off-by: Jeremy Allison <jra@samba.org>
* Fix the erroneous masking of chmod requests via the UNIX extensions.Jeremy Allison2013-08-241-7/+2
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* smbd: Fix a debug messageVolker Lendecke2013-08-231-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Simplify new_break_message_smb1Volker Lendecke2013-08-201-18/+7
| | | | | | | | | | | There's no point in allocating a fixed length array that we throw away immediately after use. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Tue Aug 20 14:35:21 CEST 2013 on sn-devel-104
* smbd: Replace a 0-timeout wakeup_sendVolker Lendecke2013-08-201-17/+13
| | | | | | | A tevent_immediate is simpler and is what we want here. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* Fix bug #10097 - MacOSX 10.9 will not follow path-based DFS referrals handed ↵Richard Sharpe2013-08-192-6/+18
| | | | | | | | | | | | | | | | out by Samba. Windows overloads the EA Length field in the DIRECTORY INFO leves of FIND FIRST/FIND NEXT. This field indicates either the REPARSE_TAG if the file/folder has a reparse proint or the EA Length if it has EAs, and is the fundamental reason you cannot have both on a file or folder. Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Aug 19 22:21:34 CEST 2013 on sn-devel-104
* smbd: Fix CID 1063259 Uninitialized scalar variableVolker Lendecke2013-08-191-0/+1
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* smbd: Do not wait unnecessarilyVolker Lendecke2013-08-161-1/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Fri Aug 16 18:46:36 CEST 2013 on sn-devel-104
* smbd: Make break_level2_to_none_async staticVolker Lendecke2013-08-162-2/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:lib: Factor read_ea_list_entry() and read_nttrans_ea_list() out so they ↵Jeremy Allison2013-08-152-104/+2
| | | | | | | can be used by the SMB2 client code. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Fix async echo handler forking (Bug 10086)Volker Lendecke2013-08-141-3/+6
| | | | | | | | | | | If SMB3 is chosen via an SMB1 negprot, we forked the echo handler because set_Protocol is called later, after the full protocol negotiation is done. 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): Wed Aug 14 15:54:43 CEST 2013 on sn-devel-104
* smbd: Fix CID 1035550 Structurally dead codeVolker Lendecke2013-08-121-38/+29
| | | | | | | | | | | Just a single ctl_code from my point of view is okay with an if(). All other cases are handled behind the VFS these days. The dead code was the last tevent_req_nterror and post routines. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:smbd: allow info class SMB_QUERY_FS_ATTRIBUTE_INFO to return partial dataRalph Wuerthner2013-08-051-0/+6
| | | | | Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
* s3:smbd: allow info class SMB_QUERY_FS_VOLUME_INFO to return partial dataRalph Wuerthner2013-08-051-0/+6
| | | | | Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
* s3:smbd: allow status code in smbd_do_qfsinfo() to be set by information ↵Ralph Wuerthner2013-08-051-1/+2
| | | | | | | class handler Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
* s3:smbd: allow GetInfo responses with STATUS_BUFFER_OVERFLOW to return ↵Ralph Wuerthner2013-08-051-3/+10
| | | | | | | partial, but valid data Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
* s3:smbd: return NT_STATUS_INFO_LENGTH_MISMATCH for GetInfo in case ↵Ralph Wuerthner2013-08-051-0/+5
| | | | | | | output_buffer_length is too small Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
* Fix bug #10010 - Missing integer wrap protection in EA list reading can ↵Jeremy Allison2013-08-051-0/+12
| | | | | | | | cause server to loop with DOS. Ensure we never wrap whilst adding client provided input. Signed-off-by: Jeremy Allison <jra@samba.org>
* s3-rpc_cli: pass down ndr_interface_table to rpc_pipe_open_interface().Günther Deschner2013-08-052-19/+19
| | | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* Ensure we can never integer wrap when working on client-supplied max_data_bytes.Jeremy Allison2013-08-041-0/+22
| | | | | | | | | | | | This would only be possible with SMB2, and is already checked in the upper SMB2 layers, but it really doesn't hurt to have these extra checks at time of use also. 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): Sun Aug 4 16:54:04 CEST 2013 on sn-devel-104
* There are tests all over the SMB1 code to check that srv_send_smb fails, but ↵Richard Sharpe2013-08-031-1/+1
| | | | | | | | | | | | | | it never returns false. Even if the write to the socket/fd fails, we never return false and will keep reading stuff off of the input buffer until it is exhausted and then we will exit. Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Richard Sharpe <sharpe@samba.org> Autobuild-Date(master): Sat Aug 3 17:41:22 CEST 2013 on sn-devel-104
* Fix bug 9678 - Windows 8 Roaming profiles failGregor Beck2013-08-011-7/+2
| | | | | | | | | | | | | Windows 8 tries to set 'ATTRIBUTE_SECURITY_INFORMATION' on some dirs. Ignoring it makes roaming profiles work again. Just like w2k3 gracefully ignore all the other bits. Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Aug 1 20:58:25 CEST 2013 on sn-devel-104
* Wrap setting leases in become_root()/unbecome_root() to ensure correct ↵Jeremy Allison2013-07-311-13/+20
| | | | | | | | | | delivery of signals. Remove workaround for Linux kernel bug https://bugzilla.kernel.org/show_bug.cgi?id=43336 as we don't need to set capabilities when we're already root. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org>
* smbd: Fix CID 1035536 Uninitialized pointer readVolker Lendecke2013-07-231-1/+1
| | | | | | | | | | | rpc_pipe_open_interface just returns okay if the pipe in question is already open. For this, it needs to read the value. 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): Tue Jul 23 02:05:19 CEST 2013 on sn-devel-104
* smbd: Fix CID 1035537 Uninitialized pointer readVolker Lendecke2013-07-221-1/+1
| | | | | | | | rpc_pipe_open_interface just returns okay if the pipe in question is already open. For this, it needs to read the value. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Fix CID 1035538 Uninitialized pointer readVolker Lendecke2013-07-221-1/+1
| | | | | | | | rpc_pipe_open_interface just returns okay if the pipe in question is already open. For this, it needs to read the value. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Reply with correct trans2 message on a setpathinfo with a bad EA name.Jeremy Allison2013-07-191-1/+10
| | | | | | | | Bug 9992 - Windows error 0x800700FE when copying files with xattr names containing ":" Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Ensure we do pathname processing before SD and EA processing in NTTRANS_CREATE.Jeremy Allison2013-07-191-38/+38
| | | | | | | | Bug 9992 - Windows error 0x800700FE when copying files with xattr names containing ":" Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Ensure we can't create a file using NTTRANS with an invalid EA list.Jeremy Allison2013-07-191-0/+20
| | | | | | | | Bug 9992 - Windows error 0x800700FE when copying files with xattr names containing ":" Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Ensure we can't create a file using TRANS2_OPEN with an invalid EA list.Jeremy Allison2013-07-191-0/+14
| | | | | | | | Bug 9992 - Windows error 0x800700FE when copying files with xattr names containing ":" Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Add the ability to send an NTSTATUS result back with a trans2 reply so we ↵Jeremy Allison2013-07-193-14/+32
| | | | | | | | | | | | | can return a parameter block with an error code. This is needed when returning a STATUS_INVALID_NAME result (tested from Windows 2012). Bug 9992 - Windows error 0x800700FE when copying files with xattr names containing ":" Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Ensure we can't create a file using SMB2_CREATE with an invalid EA list.Jeremy Allison2013-07-191-0/+5
| | | | | | | | Bug 9992 - Windows error 0x800700FE when copying files with xattr names containing ":" Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Ensure we never return an EA name to a Windows client it can't handle.Jeremy Allison2013-07-191-0/+9
| | | | | | | | Bug 9992 - Windows error 0x800700FE when copying files with xattr names containing ":" Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Ensure set_ea cannot set invalid Windows EA names.Jeremy Allison2013-07-191-0/+9
| | | | | | | | Bug 9992 - Windows error 0x800700FE when copying files with xattr names containing ":" Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Fix memory leak in error code path.Richard Sharpe2013-07-181-0/+1
| | | | | | | | Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Jul 18 03:22:37 CEST 2013 on sn-devel-104
* smbd: Fix a 100% loop at shutdown timeVolker Lendecke2013-07-111-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
* smbd: Fix a profile problemVolker Lendecke2013-07-095-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>
* s3:smbd/close remove filesystem lock before removing sharemodeChristian Ambach2013-06-251-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
* s3:smbd/close use common exit pathChristian Ambach2013-06-251-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>
* s3:smbd/aio mark file as modified in the SMB2 caseChristian Ambach2013-06-251-0/+2
| | | | | Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* Fix bug #9166 - Starting smbd or nmbd with stdin from /dev/null results in ↵Jeremy Allison2013-06-201-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>
* smbd: Remove an unused variableVolker Lendecke2013-06-121-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
* smbd: Fix a const warningVolker Lendecke2013-06-111-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Fix a const warningVolker Lendecke2013-06-111-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Remove unused codeVolker Lendecke2013-06-111-7/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>