summaryrefslogtreecommitdiff
path: root/source3/smbd
AgeCommit message (Collapse)AuthorFilesLines
2013-09-06smbd: Slightly simplify do_break_to_noneVolker Lendecke1-2/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-06smbd: Slightly simplify send_break_messageVolker Lendecke1-2/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-06smbd: Remove a silly "? true : false"Volker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-06smbd: Apply some const to message_to_share_mode_entryVolker Lendecke2-2/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-06smbd: Fix a const warningVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-06smbd: Remove two confusing TALLOC_FREE callsVolker Lendecke1-2/+0
We don't have lck allocated yet at these points. Remove the TALLOC_FREE calls that triggered me looking for the get_share_mode_lock calls. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-06smbd: Remove unused should_notify_deferred_opensVolker Lendecke2-11/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-06smbd: Remove FORCE_OPLOCK_BREAK_TO_NONEVolker Lendecke3-17/+4
This flag existed to break an exclusive or batch oplock in just one instead of two steps down to "no oplock" when we did an allocation or file size change. Running raw.oplock against W2k12 differs in this respect from W2k3: W2k12 takes two steps (via level2) to break to none. This removes the special flag that we only had for compatibility with systems older than W2k12... 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): Fri Sep 6 00:47:07 CEST 2013 on sn-devel-104
2013-09-05smbd: Fix breaking level2 on allocateVolker Lendecke1-6/+7
This needs doing even if we don't have strct allocate set. The client should not know that we lied. Fixes smb2.oplock.batch12. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-09-04smbd: Add a paranoia check to oplock_timeout_handlerVolker Lendecke1-0/+2
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 Sep 4 22:36:24 CEST 2013 on sn-devel-104
2013-09-04smbd: Fix an ancient oplock bugVolker Lendecke1-0/+2
If we get an oplock break response, we forgot to remove the oplock break timeout. Found by stopping raw.oplock.exclusive5 after the 2nd open and watching a debug level 10 log. This amends 08a9de89 from 2007. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-09-03smbd: Simplify find_oplock_typesVolker Lendecke1-9/+10
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-08-28smbd: Correctly return INFO_LENGTH_MISMATCH for smb1Volker Lendecke1-0/+4
This is required if the client offered less buffer than the fixed portion of the info level data requires Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-28smbd: Fix error return for STREAM_INFOVolker Lendecke1-0/+4
The stream_info marshalling follows its own rules. This needs unifying eventually... Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-28smbd: Revert a93f9c3Volker Lendecke1-5/+0
This was too broad and has been replaced by finer-grained error checks Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-28smbd: Correctly return BUFFER_OVERFLOW in smb2_getinfoVolker Lendecke1-0/+10
Also, don't overflow the client buffer Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-28smbd: Correctly return INFO_LENGTH_MISMATCH in smb2_getinfoVolker Lendecke1-0/+12
We have to return this error if the client offered less than the fixed portion of the infolevel data requires Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-28smbd: qfsinfo has fixed/variable buffersVolker Lendecke3-0/+13
The error message will have to change depending whether the buffer is too small for the fixed or variable buffers Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-28smbd: qfilepathinfo has fixed/variable buffersVolker Lendecke3-0/+25
The error message will have to change depending whether the buffer is too small for the fixed or variable buffers Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-27smbd: Use #defines in smb2_getinfo_sendVolker Lendecke1-4/+4
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Tue Aug 27 15:08:08 CEST 2013 on sn-devel-104
2013-08-26Fix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN.Jeremy Allison1-6/+20
UNIX extensions calls must never deref links. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Aug 26 20:19:46 CEST 2013 on sn-devel-104
2013-08-26Allow UNIX extensions client to act on open fsp instead of pathname if ↵Jeremy Allison1-1/+8
available. Eliminates possible race condition on pathname op. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org>
2013-08-26Fix the erroneous masking of chmod requests via the UNIX extensions.Jeremy Allison1-8/+10
Changed from switch statement to if, as "create mask", "force create mode" are only applied to new files, not existing ones. "directory mask", "force directory mode" are only applied to new directories, not existing ones. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org>
2013-08-26smbd: Simplify dropbox special case in unix_convertVolker Lendecke1-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
2013-08-25Revert "Fix the erroneous masking of chmod requests via the UNIX extensions."Jeremy Allison1-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
2013-08-24Revert "Allow UNIX extensions client to act on open fsp instead of pathname ↵Jeremy Allison1-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.
2013-08-24Pushed from the wrong branch - this is the versionJeremy Allison1-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.
2013-08-25Fix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN.Jeremy Allison1-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
2013-08-24Allow UNIX extensions client to act on open fsp instead of pathname if ↵Jeremy Allison1-1/+8
available. Eliminates possible race condition on pathname op. Signed-off-by: Jeremy Allison <jra@samba.org>
2013-08-24Fix the erroneous masking of chmod requests via the UNIX extensions.Jeremy Allison1-7/+2
Signed-off-by: Jeremy Allison <jra@samba.org>
2013-08-23smbd: Fix a debug messageVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-20smbd: Simplify new_break_message_smb1Volker Lendecke1-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
2013-08-20smbd: Replace a 0-timeout wakeup_sendVolker Lendecke1-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>
2013-08-19Fix bug #10097 - MacOSX 10.9 will not follow path-based DFS referrals handed ↵Richard Sharpe2-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
2013-08-19smbd: Fix CID 1063259 Uninitialized scalar variableVolker Lendecke1-0/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-08-16smbd: Do not wait unnecessarilyVolker Lendecke1-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
2013-08-16smbd: Make break_level2_to_none_async staticVolker Lendecke2-2/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-08-15s3:lib: Factor read_ea_list_entry() and read_nttrans_ea_list() out so they ↵Jeremy Allison2-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>
2013-08-14smbd: Fix async echo handler forking (Bug 10086)Volker Lendecke1-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
2013-08-12smbd: Fix CID 1035550 Structurally dead codeVolker Lendecke1-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>
2013-08-05s3:smbd: allow info class SMB_QUERY_FS_ATTRIBUTE_INFO to return partial dataRalph Wuerthner1-0/+6
Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2013-08-05s3:smbd: allow info class SMB_QUERY_FS_VOLUME_INFO to return partial dataRalph Wuerthner1-0/+6
Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2013-08-05s3:smbd: allow status code in smbd_do_qfsinfo() to be set by information ↵Ralph Wuerthner1-1/+2
class handler Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2013-08-05s3:smbd: allow GetInfo responses with STATUS_BUFFER_OVERFLOW to return ↵Ralph Wuerthner1-3/+10
partial, but valid data Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2013-08-05s3:smbd: return NT_STATUS_INFO_LENGTH_MISMATCH for GetInfo in case ↵Ralph Wuerthner1-0/+5
output_buffer_length is too small Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2013-08-05Fix bug #10010 - Missing integer wrap protection in EA list reading can ↵Jeremy Allison1-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>
2013-08-05s3-rpc_cli: pass down ndr_interface_table to rpc_pipe_open_interface().Günther Deschner2-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>
2013-08-04Ensure we can never integer wrap when working on client-supplied max_data_bytes.Jeremy Allison1-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
2013-08-03There are tests all over the SMB1 code to check that srv_send_smb fails, but ↵Richard Sharpe1-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
2013-08-01Fix bug 9678 - Windows 8 Roaming profiles failGregor Beck1-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