summaryrefslogtreecommitdiff
path: root/source3
AgeCommit message (Collapse)AuthorFilesLines
2013-10-15smbd: Remove a special case for level2 breakVolker Lendecke1-33/+12
With the level2 indicator in brlock.tdb this race condition does not exist anymore Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-15smbd: Remove some FAKE_LEVEL_II commentsVolker Lendecke2-8/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-15smbd: Add debugs to brlock.cVolker Lendecke2-0/+21
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-15smbd: Remove FAKE_LEVEL_II_OPLOCKVolker Lendecke5-59/+81
FAKE_LEVEL_II_OPLOCK was an indicator to break level2 oplock holders on write. This information is now being held in brlock.tdb, which makes the FAKE_LEVEL_II_OPLOCK type unnecessary. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-15smbd: Put "have_read_oplocks" into brlock.tdbVolker Lendecke2-10/+48
This implements an idea by metze: Right now Samba does not grant level2 oplocks where it should: After an initial no-oplock open that has been written to, we don't have the FAKE_LEVEL2_OPLOCK entry in locking.tdb around anymore, this downgraded to NO_OPLOCK. Windows in this case will grant level2 if being asked, we don't. Part of the reason for this is that we don't have a proper mechanism to communicate the fact that level2 needs to be broken to other smbds. Metze's insight was that we have to look into brlock.tdb for every write anyway, so this might be the right place to store this information. My first reaction was that this is really hackish, but on further thought this is not. oplocks depend on brlocks anyway, and we have the proper mechanisms in place for brlocks. The format for this change is to add one byte to the end of the brlock.tdb record with value 1 if we have level2 oplocks around. Thus this patch effectively reverts 8f41142 which I discovered while writing this change. We now legally have unaligned records. We can certainly talk about the format, but I'm not yet convinced we need an idl for this yet. This is a potentially very hot code path, and ndr marshalling has a cost. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-15s3-winbindd: Remove undocumented winbindd:socket dir parameterAndrew Bartlett4-8/+4
This uses the documeted "winbindd socket directory" parameter instead. This came about due to the merge of the two smb.conf tables in s3 and s4 for the Samba 4.0 release. The s4 code used a real parameter, which caused this to be documented, whereas no automatic procedure existed to notice the parametric option and the need to document that. The fact that this was not used consistently in both codebases is one of the many areas of technical debt we still need to pay off here. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2013-10-14param: disable print notify backchannel by defaultDavid Disseldorp1-1/+1
In handling RemoteFindFirstPrinterChangeNotifyEx requests, the spoolss server can establish a "backchannel" connection to the print client, as a mechanism for sending print notifications. This behaviour is governed by the "print notify backchannel" smb.conf parameter. This change sets "print notify backchannel" to "no" by default, which sees Samba respond to RemoteFindFirstPrinterChangeNotifyEx requests with WERR_SERVER_UNAVAILABLE. In recieving such a response, print clients can fall back to polling for print queue changes. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Mon Oct 14 18:49:41 CEST 2013 on sn-devel-104
2013-10-13smbd: Remove unused create_options from open_mode_checkVolker Lendecke1-3/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Sun Oct 13 14:35:26 CEST 2013 on sn-devel-104
2013-10-13smbd: Remove name_hash param from open_mode_checkVolker Lendecke1-3/+2
This came from delete_on_close handling which was factored out. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-12s3/time_audit: Add offline and durable functionsChristof Schmitt1-0/+111
Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Sat Oct 12 13:00:02 CEST 2013 on sn-devel-104
2013-10-12vfs: Fix parentheses in SMB_VFS_NEXT_DURABLE_COOKIEChristof Schmitt1-1/+1
Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-12smbd: Fix the extended *.oplock.doc1 testsVolker Lendecke1-26/+33
We need to check for DELETE_PENDING before the first oplock break 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 Oct 12 01:56:18 CEST 2013 on sn-devel-104
2013-10-11s3-winbind: Send online/offline message of the domain to the parent.Andreas Schneider1-0/+22
https://bugzilla.samba.org/show_bug.cgi?id=10194 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Oct 11 13:37:56 CEST 2013 on sn-devel-104
2013-10-11s3-winbind: Register handlers for domain online/offline messages.Andreas Schneider2-0/+11
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10194 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-11s3-winbind: Add functions for domain online/offline handling.Andreas Schneider2-0/+50
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10194 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-11idl: Add a new message for winbind domain states.Andreas Schneider1-0/+2
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10194 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-09Fix bug #10187 - Missing talloc_free can leak stackframe in error path.Jeremy Allison1-2/+3
Fix error path. 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): Wed Oct 9 03:50:56 CEST 2013 on sn-devel-104
2013-10-09smbd: Fix an error path in open_directoryVolker Lendecke1-0/+1
In open_file_ntcreate we do the del_share_mode on error. We should do it here as well. 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 Oct 9 01:58:55 CEST 2013 on sn-devel-104
2013-10-08smbd: Simplify set_share_modeVolker Lendecke1-30/+15
With the find_share_mode simplification we don't need fill_share_mode anymore. So this coalesces add_share_mode as well. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-08smbd: Simplify find_share_mode_entry callersVolker Lendecke1-46/+25
All callers used fill_share_mode_entry before calling find_share_mode_entry. Remove that requirement. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-08smbd: Convert set_share_mode to return bool for successVolker Lendecke3-8/+17
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-08smbd: Make add_share_mode return boolVolker Lendecke1-4/+13
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-08smbd: Change parameter from unsigned to uint32_tVolker Lendecke2-2/+2
share_mode_stale_pid internally only has to deal with uint32_t. Make the parameter match this. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-06smbd: Remove byte_range_lock->read_onlyVolker Lendecke1-10/+0
With the rewritten brl_get_lock_readonly we only set the destructor for r/w lock records anyway. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Sun Oct 6 22:20:05 CEST 2013 on sn-devel-104
2013-10-06smbd: Remove the brl_get_locks wrapperVolker Lendecke1-9/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-06smbd: brl_get_locks_internal is always called r/w nowVolker Lendecke1-37/+11
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-06smbd: Restructure brl_get_locks_readonlyVolker Lendecke1-10/+103
This is step 1 to get rid of brl_get_locks_internal with its complex readonly business. It also optimizes 2 things: First, it uses dbwrap_parse_record to avoid a talloc and memcpy, and second it uses talloc_pooled_object. And -- hopefully it is easier to understand the caching logic with fsp->brlock_rec and the clustering escape. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-06smbd: Avoid an if-statement per read/write in the non-clustered caseVolker Lendecke1-4/+4
Without clustering, fsp->brlock_rec will never be set anyway. In the clustering case we can't use the seqnum trick, so this is slow enough that the additional if-statement does not matter in this case anyway. In the non-clustered case it might. Have not measured it, but every little bit helps I guess. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-06smbd: Remove unused "brl->key" struct elementVolker Lendecke1-3/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Sun Oct 6 15:49:43 CEST 2013 on sn-devel-104
2013-10-06smbd: Convert some dbgtxt to DEBUGVolker Lendecke1-19/+12
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-06smbd: Fix a commentVolker Lendecke1-1/+1
This has been converted from a timed event to an immediate one in e7dab403c0ca6f6 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-06smbd: Fix confusing commentsVolker Lendecke2-4/+2
The brlock-check is done in grant_fsp_oplock_type Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-06smbd: Avoid calling serverid_exists twiceVolker Lendecke1-0/+6
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05smbd:smb2: clarify and comment code treating dh2c blob check.Michael Adam1-6/+22
This makes the code that checks for extra create blobs in the case of the dh2c blob look very similar to the corresponding (slightly mode complex) code for the dhnc blob. With this preparation it will be easier and more obvious how to add proper treatment of the lease request blobs when leases get implemented. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Sat Oct 5 15:56:11 CEST 2013 on sn-devel-104
2013-10-05smbd:smb2: ignore an dhnq blob along with a dhnc in createMichael Adam1-6/+26
This is according to MS-SMB2, 3.3.5.9.7 "Handling the SMB2_CREATE_DURABLE_HANDLE_RECONNECT Create Context" Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05smbd:smb2_create: fix return code for durable handle create blob combinationsMichael Adam1-8/+16
According to MS-SMB2: 3.3.5.9.7 Handling the SMB2_CREATE_DURABLE_HANDLE_RECONNECT Create Context 3.3.5.9.12 Handling the SMB2_CREATE_DURABLE_HANDLE_RECONNECT_V2 Create Context and verified by test results. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05smbd:smb2: successfully answer a DHnC request when the initial create was DH2QMichael Adam3-7/+18
I.e. the durable reconnect attempt is v1 while the original create was durable v2 including the create guid. Implement this by skipping the create_guid verification when the reconnect request is v1. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05smbd:smb2_create: add comment about validity of check reconnect blob being ↵Michael Adam1-0/+4
only one With leases this will not be true any more. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05shadow_copy2: use stored mount_point instead of recalculating.Michael Adam1-9/+1
In the case of snapdirseverywhere but NOT crossmountpoints. This spares stat calls. And is the only correct thing to do if the mount point was specified in the configuration. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: improve debug in shadow_copy2_convert() in snapdirseverywhere modeMichael Adam1-1/+2
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: fix shadow_copy2_convert() in the classical case.Michael Adam1-2/+45
I.e. the non-snapdirseverywhere case. This in particular fixes the case of a snapdir hierarchy that is parallel to the share or mountpoint and not subordinate. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: add some blank lines for visual separation to ↵Michael Adam1-0/+2
shadow_copy2_convert() Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: initialize "converted" string to null in shadow_copy2_convert()Michael Adam1-1/+1
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: fix shadow_copy2_strip_snapshot() in the classical caseMichael Adam1-0/+30
I.e., fix detection of already converted names. This is done by using the shadow_copy2_snapshot_path() function and comparing if the input string starts with that. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: add some debug to shadow_copy2_strip_snapshot()Michael Adam1-1/+11
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: add comments explaining decisions in shadow_copy2_strip_snapshot()Michael Adam1-0/+10
This should make it more easy to understand what the cases are. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: introduce shadow_copy2_snapshot_path()Michael Adam1-0/+37
This builds the posix snapshot path for the connection at the provided timestamp. For the non-snapdirseverywhere case. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: factor shadow_copy2_posix_gmt_string() out of ↵Michael Adam1-21/+47
shadow_copy2_insert_string() for re-use.. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: shadow_copy2_insert_string(): do not prepend a "/" in absolute ↵Michael Adam1-2/+20
mode Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: make shadow_copy2_find_snapdir() return const char *Michael Adam1-4/+4
instead of char *. This eliminates compiler warnings. snapdir is a const string in all occasions. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>