summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
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-05s4:torture:smb2: add durable-v2-open.reopen2cMichael Adam1-0/+75
- create durable with v1 request - reconnect with v2 reconnect request ==> fails Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05s4:torture:smb2: add durable-v2-open.reopen2bMichael Adam1-0/+91
- connect with durable v2 - reconnect with durable v1 => succeeds Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05s4:torture:smb2: add durable-v2-open.create-blobMichael Adam1-0/+108
test various combinations of durable create and reconnect request blobs, according to MS-SMB2, 3.3.5.9.12: "Handling the SMB2_CREATE_DURABLE_HANDLE_RECONNECT_V2 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-05s4:torture:smb2: extend the durable-open.reopen2 testMichael Adam1-18/+83
Add tests for: - filename and many other things don't matter in reconnect - additionally specified DHnQ request blob is ignored. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05s4:torture:smb2: extend the durable-v2-open.reopen2 testMichael Adam1-4/+44
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-05s4:torture:smb2: add a durable-open.reopen-lease-v2 testMichael Adam1-0/+238
like durable-open.reopen2-lease but with v2 lease requets Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05s4:torture:smb2: add durable-v2-open.reopen2-lease-v2Michael Adam1-0/+245
lease v2 variant of the reopen2 test. Test various success and failure cases. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05s4:torture:smb2: add smb2_lease_v2_create() wrapper to ↵Michael Adam1-0/+16
smb2_lease_v2_create_share() that sets share all. similar to smb2_lease_create() Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05s4:torture:smb2: add durable-v2-open.reopen2-leaseMichael Adam1-0/+247
lease v1 variant of the reopen2 test Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05s4:torture:smb2: add durable-open.reopen2-lease testMichael Adam1-0/+238
lease-variant of the reopen2 test Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05s4:torture:smb2: fix durable-open lease tests to pass against windows.Michael Adam1-2/+8
Fix is: reconnect with same client-guid as on the first connection. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-05s4:torture:smb2: add smbcli_options argument to torture_smb2_connection_ext()Michael Adam3-13/+46
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-05s4:libcli:smb2: make smbcli_options argument to smb2_connect_(send|ext) constMichael Adam1-2/+2
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-05s4:libcli:smb2: add the smb2_capabilities to the smbcli_optionsMichael Adam3-4/+3
and initialize them in lpcfg_smbcli_options() instead of in smb2_transport_init() as previously. This will allow us to control them from callers later. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-05s4:libcli:smb2: add the client_guid to the smbcli_optionsMichael Adam3-4/+4
and initialize it in lpcfg_smbcli_options() instead of in smb2_transport_init() as previously. Having the client guid in the smbcli_options will allow us to control them from callers later. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-05s4:torture:spoolss: use smb2_connect() instead of smb2_connet_ext()Michael Adam1-12/+11
in print_test_smbd: we don't need to pass the previous_session_id. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05s4:torture:smb2: fix a comment in the durable-open.lock-oplock testMichael Adam1-1/+1
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-05samba_backup: fix bug, add command line parameter, improve error messagesBrian Martin1-15/+37
Also remove .bak suffix from tdb/ldb backups for more consistent restore procedures Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Matthieu Patou <mat@matws.net> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat Oct 5 13:51:34 CEST 2013 on sn-devel-104
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>
2013-10-05shadow_copy2: in the classical case, use configured path in ↵Michael Adam1-0/+7
shadow_copy2_find_snapdir() There is no point in searching for snapdir if not in snapdirseverywhere mode. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: implement disk_freeMichael Adam1-0/+37
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: log resulting config at the end of shadow_copy2_connect()Michael Adam1-0/+29
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: add snapshot_basepath to the config.Michael Adam1-0/+11
This is the absolute version of snapdir. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: add rel_connectpath to config.Michael Adam1-0/+12
This is the share root, relative to the basedir. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: introduce "shadow:mountpoint" optionMichael Adam1-5/+38
Possiblity to explicitly set the share's mount point. This is useful mainly for debugging and testing purposes. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: re-add the basedir option.Michael Adam1-0/+56
Disable basedir if it is not an absolute path or if snapdirseverywhere or crossmountpoints is enabled. Pair-Programmed-With: Björn Baumbach <bb@sernet.de> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: disable "snapdir:crossmountpoints" if the snapdir is absolute.Michael Adam1-0/+7
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: introduce the bool "snapdir_absolute" in the config.Michael Adam1-0/+10
Not exposed but to be used internally. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: introduce config struct and function shadow_copy2_connect()Michael Adam1-28/+145
This moves the parsing of the config to a central place. So users of configuation don't need to call lp_parm_... all the time. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: add comment explaining the SMB level GMT format patternMichael Adam1-1/+9
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: add comment block explaining shadow_copy2_convert()Michael Adam1-0/+5
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: add comment block explaining shadow_copy2_insert_string()Michael Adam1-0/+5
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: add comment block explaining shadow_copy2_find_snapdir()Michael Adam1-0/+4
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-05shadow_copy2: add header comment explaining have_snapdir()Michael Adam1-0/+6
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>