summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* ctdb-common: Protocol argument must be in host order for socket() callAmitay Isaacs2016-02-046-10/+10
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11705 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 9f8395cb7d49b63a82f75bf504f5f83920102b29)
* s3: smbd: Fix timestamp rounding inside SMB2 create.Jeremy Allison2016-02-021-0/+8
| | | | | | | | | | | | | | | | | | | | Setting "dos filetime resolution = yes" should round to 2 second increments. Fix missing path inside smbd. Fix confirmed by reporter Hubert Gilch <hg@sepag.de>. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11703 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): Fri Jan 29 10:41:01 CET 2016 on sn-devel-144 (cherry picked from commit 8024f532e6bcb6cbd8179817fafdd0f12929d629) Autobuild-User(v4-3-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-3-test): Tue Feb 2 15:33:08 CET 2016 on sn-devel-104
* smbd: show correct disk size for different quota and dfree block sizesUri Simchoni2016-02-021-1/+8
| | | | | | | | | | | When file system stats (VFS disk_free_fn) and quota (VFS get_quota_fn) return different block sizes, normalize values before comparing. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11681 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 67c89715d00abc588239d8220f09cf51a58db05a)
* s3:utils/smbget fix recursive downloadChristian Ambach2016-02-021-1/+14
| | | | | | | | | | | get_auth_data is called multiple times (once for the directory listing and then for every file to be downloaded). Save the obtained values across multiple calls to make smbclient use the correct username for each download. Bug: https://bugzilla.samba.org/show_bug.cgi?id=6482 Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit ec802d27ce4dc6dd9b5e5ebd6992f90364d855a2)
* waf: Only build smb_krb5_wrapper if we have CUPSAndreas Schneider2016-02-021-1/+2
| | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 192f1516c378ae942d14921bfcc1e11173da36e6)
* s3-client: Add a KRB5 wrapper for smbspoolAndreas Schneider2016-02-023-0/+234
| | | | | | | | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11690 We need a wrapper for smbspool to be able to authenticate with Kerberos. This needs to replace the cups smb backend. The permission need to be 0700 and the owner root. Note that Kerberos support is broken in CUPS 2.1.2 maybe earlier versions. It works with 1.6.3. Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Jan 25 19:58:46 CET 2016 on sn-devel-144 (cherry picked from commit 62c68bd8c8f7a7e057e38a461707f1c195e62df0)
* s3-parm: clean up defaults when removing global parametersAlexander Bokovoy2016-01-261-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11693 When globals are re-initialized, they are cleared and globals' talloc context is freed. However, parm_table still contains a reference to the global value in the defaults. This confuses lpcfg_string_free() after commit 795c543d858b2452f062a02846c2f908fe4cffe4 because it tries to free already freed pointer which is passed by lp_save_defaults(): .... case P_STRING: case P_USTRING: lpcfg_string_set(Globals.ctx, &parm_table[i].def.svalue, *(char **)lp_parm_ptr(NULL, &parm_table[i])); .... here &parm_table[i].def.svalue is passed to lpcfg_string_free() but it is a pointer to a value allocated with previous Globals.ctx which already was freed. This specifically affects registry backend of smb.conf in lp_load_ex() where init_globals() called explicitly to re-init globals after lp_save_defaults() if we have registry backend defined. Reviewed-by: Uri Simchoni <uri@samba.org> Signed-off-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Uri Simchoni <uri@samba.org> Autobuild-Date(master): Mon Jan 25 23:58:42 CET 2016 on sn-devel-144 (cherry picked from commit 500bc01478881cab89f0e691427e34a405bb0003) Autobuild-User(v4-3-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-3-test): Tue Jan 26 12:58:53 CET 2016 on sn-devel-104
* s4:torture: add SMB2 test for directory creation initial allocation sizeRalph Boehme2016-01-261-0/+64
| | | | | | | | | | | | | | | Test that directory creation with an initial allocation size > 0 succeeds. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11684 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Sun Jan 24 01:20:52 CET 2016 on sn-devel-144 (cherry picked from commit cd86f20e245cc1b0cb3be5d6cb1b45c45e2a45a8)
* s3:smbd: Ignore initial allocation size for directory creationRalph Boehme2016-01-261-7/+3
| | | | | | | | | | | | | We reject directory creation with an initial allocation size > 0 with NT_STATUS_ACCESS_DENIED. Windows servers ignore the initial allocation size on directories. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11684 Pair-Programmed-With: Volker Lendecke <vl@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 78ccbb07170c3e49a084d31434310f973e3d6158)
* smbcacls: fix uninitialized variableUri Simchoni2016-01-211-1/+1
| | | | | | | | | | | | | | | | | | An uninitialized variable causes "numeric" mode to be used without the -n option. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11682 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Wed Jan 20 12:12:12 CET 2016 on sn-devel-144 (cherry picked from commit 6cff00954763a7b266db5bab229b989e89abcee0) Autobuild-User(v4-3-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-3-test): Thu Jan 21 13:01:16 CET 2016 on sn-devel-104
* Revert "winbind: Retry after SESSION_EXPIRED error in ping-dc"Christof Schmitt2016-01-141-8/+0
| | | | | | | | | | | | | | | | | | | This reverts commit a2670f15dea27c10e3827216adf572f9c3894f85. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11670 cm_connect_netlogon now handles the retry for an expired session. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jan 13 03:35:57 CET 2016 on sn-devel-144 (cherry picked from commit 6f3656c47d8ae6a3ac10591ffd7a60797775b469) Autobuild-User(v4-3-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-3-test): Thu Jan 14 13:21:52 CET 2016 on sn-devel-104
* winbindd: Retry on expired session in cm_connect_netlogonChristof Schmitt2016-01-141-0/+8
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11670 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit aa3883eae6e7891efb1e6f9ec74e6073bee43250)
* winbindd: Retry on expired session in cm_connect_samChristof Schmitt2016-01-141-0/+48
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11670 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 276d604aa5ccc32d18b69c04ae13e2dc7c21f3ee)
* winbindd: Retry on expired session in cm_connect_lsaChristof Schmitt2016-01-141-0/+48
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11670 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 3b6b5456424be6997b32c23b7c149c8060c3102d)
* winbindd: Remove double retry from some ADS methodsChristof Schmitt2016-01-141-14/+12
| | | | | | | | | | | | The retry through the new reconnect_ads layer is enough. This structure also makes the distinction between retry layer and actual methods call a bit clearer. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11670 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 4c6804e414087fb61e66133cefbe5590d1d9b283)
* winbindd: Add retry also for ADS method callsChristof Schmitt2016-01-146-4/+335
| | | | | | | | | | | RPC calls can return IO_DEVICE_ERROR on expired SMB2 sessions. Retrying on a new connection avoids surfacing this error to winbindd clients. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11670 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit e4adf55e242aa5f000570bf554fcd15d7e86c126)
* winbindd: Reset connection for expired session before reconnectingChristof Schmitt2016-01-141-15/+24
| | | | | | | | | | | | A RPC call on a expired SMB2 session returns IO_DEVICE_ERROR. In this case, reset the connection before issuing the same call again. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11670 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit fb5b0cec3c0c2e0cf9cb04f8b52ee910ac245aeb)
* vfs_shadow_copy2: add a blackbox test suiteUri Simchoni2016-01-143-0/+360
| | | | | | | | | | | | | | | | Add a blackbox test suite for vfs_shadow_copy2, testing parameters mountpoint, basedir, snapdir, snapdirseverywhere, and testing correct wide-link processing. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11580 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Wed Jan 13 17:11:38 CET 2016 on sn-devel-144 (cherry picked from commit 7362c27a62e3802fc8df975ce50115b683811f4a)
* vfs_shadow_copy2: fix case where snapshots are outside the shareUri Simchoni2016-01-141-22/+46
| | | | | | | | | | | | | | | | | | Adjust the connect path to the root of the share in the snapshot, or to the root of the snapshot if the snapshot is "inside" the share. This way snapshot symlink regarded as "wide links" if and only if they point outside the snapshot or they were wide links when the snapshot was taken. This allows mounting the snapshots outside the share's root. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11580 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> (cherry picked from commit 8a49a63a5a5d8014d32179df1789186223443b35)
* vfs_shadow_copy2: add shadow_copy2_do_convert()Uri Simchoni2016-01-141-4/+35
| | | | | | | | | | | | | | | | Add a new routine shadow_copy2_do_convert() which is like shadow_copy2_convert(), but beside calculating the path of the snapshot file, it also returns the minimum length of the subpath which is both inside the share and inside the same snapshot as the file in question, i.e. (at least in the classical case) the subdirectory of the the snapshot file's snapshot directory that corresponds to the file's share root. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11580 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> (cherry picked from commit 3703bca4d9e494aec0b40243add3e076cf353601)
* s3:smbd/oplock obey kernel oplock setting when releasing oplocksChristian Ambach2016-01-141-1/+2
| | | | | | | | | | | | | | otherwise smbd asks the kernel to release an oplock that was never requested Bug: https://bugzilla.samba.org/show_bug.cgi?id=11400 Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jan 6 08:58:56 CET 2016 on sn-devel-144 (cherry picked from commit eda6aaf1533b69d093ba67ff5e22fcda0073dd3f)
* selftest: more dfree command and smbclient disk usage testsUri Simchoni2016-01-143-6/+21
| | | | | | | | | | | | | | | Add tests that cover disk usage printing by smbclient, as well as passing directory info to the "dfree command" script. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11662 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jan 6 03:58:59 CET 2016 on sn-devel-144 (cherry picked from commit 3e1b26bd6d0998c3af3d77f94eaac469434389be)
* smbclient: query disk usage relative to current directoryUri Simchoni2016-01-146-7/+11
| | | | | | | | | | | | | When querying disk usage in the "dir" and "du" commands, use the current directory. This behavior is compatible with Windows command shell "dir" command. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11662 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 275da6c5c7e7c5dd0581e919912eb82102903a46)
* VERSION: Bump version up to 4.3.5...Karolin Seeger2016-01-111-2/+2
| | | | | | | | | and re-enable git snapshots. Signed-off-by: Karolin Seeger <kseeger@samba.org> Autobuild-User(v4-3-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-3-test): Mon Jan 11 14:23:41 CET 2016 on sn-devel-104
* VERSION: Disable git snapshots for the 4.3.4 release.samba-4.3.4Karolin Seeger2016-01-111-1/+1
| | | | Signed-off-by: Karolin Seeger <kseeger@samba.org>
* WHATSNEW: Add release notes for Samba 4.3.4.Karolin Seeger2016-01-111-2/+75
| | | | Signed-off-by: Karolin Seeger <kseeger@samba.org>
* s3:torture: add traverse testing to LOCAL-RBTREEStefan Metzmacher2016-01-111-0/+39
| | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11375 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11394 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Nov 27 13:16:59 CET 2015 on sn-devel-104 (cherry picked from commit bb9f13ab4165f150e01a88ddcc51605a7c176f5d)
* dbwrap_rbt: fix modifying the db during traverseStefan Metzmacher2016-01-111-47/+57
| | | | | | | | | | | | | | | | | | | | | We delete and add of records rebalace the tree, but our traverse code doesn't handle that and skips records randomly. We maintain records in a linked list for now in addition to the rbtree and use that list during traverse. This add a bit overhead, but at least it works reliable. If someone finds a way to do reliable traverse with the rebalanced tree, we can replace this commit. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11375 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11394 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 0f46da08e160e6712e5282af14e1ec4012614fc7)
* dbwrap_rbt: add nested traverse protectionStefan Metzmacher2016-01-111-31/+40
| | | | | | | | | | | | | | | | | | | Multiple dbwrap_traverse_read() calls are possible. store() and delete() on a fetch locked record are rejected during dbwrap_traverse_read(). A dbwrap_traverse() within a dbwrap_traverse_read() behaves like a dbwrap_traverse_read(). Nested dbwrap_traverse() calls are not possible. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11375 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11394 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 590507951fc514a679f44b8bfdd03c721189c3fa)
* dbwrap_rbt: use talloc_zero_size() instead of a partial ZERO_STRUCT()Stefan Metzmacher2016-01-111-3/+1
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11375 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11394 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit f3d1fc1d06822a951a2a3eeb5aa53748b9b5b299)
* Revert "Fix bug #11394 - Crash: Bad talloc magic value - access after free"Karolin Seeger2016-01-112-127/+71
| | | | | | | This reverts commit 569ce95de57511d6082196ca4cc0938d78700351. This has been committed by accident. Right patchset, but wrong authorship. Patchset with correct authorship to follow.
* password_lockout: test creds.get_kerberos_state()Douglas Bagnall2016-01-061-0/+1
| | | | | | | | | | | | | | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Garming Sam <garming@samba.org> Autobuild-Date(master): Tue Dec 15 03:17:52 CET 2015 on sn-devel-104 (cherry picked from commit ab1ebb1d1c650396841e4ba4a18b3c08689d4f52) BUG: https://bugzilla.samba.org/show_bug.cgi?id=11659 lastLogon and lastLogonTimestamp are not updated Autobuild-User(v4-3-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-3-test): Wed Jan 6 13:14:21 CET 2016 on sn-devel-104
* auth: keep track of lastLogon and lastLogonTimestampDouglas Bagnall2016-01-064-55/+451
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lastLogon is supposed to be updated for every interactive or kerberos login, and (according to testing against Windows2012r2) when the bad password count is non-zero but the lockout time is zero. It is not replicated. lastLogonTimestamp is updated if the old value is more than 14 - random.choice([0, 1, 2, 3, 4, 5]) days old, and it is replicated. The 14 in this calculation is the default, stored as "msDS-LogonTimeSyncInterval", which we offer no interface for changing. The authsam_zero_bad_pwd_count() function is a convenient place to update these values, as it is called upon a successful logon however that logon is performed. That makes the function's name inaccurate, so we rename it authsam_logon_success_accounting(). It also needs to be told whet5her the login is interactive. The password_lockout tests are extended to test lastLogon and lasLogonTimestamp. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 795f4729ca94029fcee750fbebbe9bc3ea43a214) BUG: https://bugzilla.samba.org/show_bug.cgi?id=11659 lastLogon and lastLogonTimestamp are not updated
* password_lockout tests: add assertLoginFailure()Douglas Bagnall2016-01-061-10/+12
| | | | | | | | | | | | | | | | In a few places where a login should fail in a particular way, an actual login success would not have triggered a test failure -- only the wrong kind of login failure was caught. This makes a helper function to deal with them all. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 909ebe0191a409c107904df658dc9111dd5de669) BUG: https://bugzilla.samba.org/show_bug.cgi?id=11659 lastLogon and lastLogonTimestamp are not updated
* auth: increase resolution for password grace period calculationDouglas Bagnall2016-01-061-1/+3
| | | | | | | | | | | | | | | This changes the resolution of "now" from 1s to 100ns. It should have little effect in practice, unless users are in the habit of playing chicken with the grace period. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit d097e813fff3aaed261a18d8066e6bd11f12abad) BUG: https://bugzilla.samba.org/show_bug.cgi?id=11659 lastLogon and lastLogonTimestamp are not updated
* pycredentials: add get_kerberos_state() methodDouglas Bagnall2016-01-061-0/+8
| | | | | | | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 8b26559aeb6d1c2c12e2ea374c30e4082ece7ec3) BUG: https://bugzilla.samba.org/show_bug.cgi?id=11659 lastLogon and lastLogonTimestamp are not updated
* smbd: do not disable "store dos attributes" on-the-flyUri Simchoni2016-01-063-36/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Smbd would disable "store dos attributes" on-the-fly if the attempt to set/get user.DOSATTRIB fails with ENOTSUP or ENOSYS. The rationale behind it was that the file system does not support extended attributes, so there's no need to fill up the log with failure messages. However, a "wide symlink" could point to a spot that doesn't support extended attributes. Even with the default banned wide links, we currenly allow stat'ing those files and follow the symlink, and this in turn would disable "store dos attributes" for the whole share. The user.DOSATTRIB attribute also stores file creation time, so that is also affected. Another case where this behavior would turn storage of DOS attributes off is that of the ".." entry at the root of the share, if the parent folder for the share's root path does not support extended attributes. On the other hand, the information on the file system and its support of extended attributes is readily available, so the fix for explosion of the log should be not to configure "store dos attributes" on such a share. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11649 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Dec 25 13:20:58 CET 2015 on sn-devel-144 (cherry picked from commit d4c2395e6428312854b8570064bddab3a7f188ff)
* s3:smbd: fix a corner case of the symlink verificationMichael Adam2016-01-061-25/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 7606c0db257b3f9d84da5b2bf5fbb4034cc8d77d fixes the path checks in check_reduced_name[_with_privilege]() to prevent unintended access via wide links. The fix fails to correctly treat a corner case where the share path is "/". This case is important for some real world scenarios, notably the use of the glusterfs VFS module: For the share path "/", the newly introduced checks deny all operations in the share. This change fixes the checks for the corner case. The point is that the assumptions on which the original checks are based are not true for the rootdir "/" case. This is the case where the rootdir starts _and ends_ with a slash. Hence a subdirectory does not continue with a slash after the rootdir, since the candidate path has been normalized. This fix just omits the string comparison and the next character checks in the case of rootdir "/", which is correct because we know that the candidate path is normalized and hence starts with a '/'. The patch is fairly minimal, but changes indentation, hence best viewed with 'git show -w'. A side effect is that the rootdir="/" case needs one strncmp less. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11647 Pair-Programmed-With: Jose A. Rivera <jarrpa@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Jose A. Rivera <jarrpa@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Thu Dec 24 00:57:31 CET 2015 on sn-devel-144 (cherry picked from commit ada59ec7b3a5ed0478d11da2fe0c90991d137288)
* s3: libsmb: Correctly initialize the list head when keeping a list of ↵Jeremy Allison2016-01-061-2/+2
| | | | | | | | | | | | | | | | | primary followed by DFS connections. Greatly helped by <shargagan@novell.com> to track down this issue. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11624 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): Fri Dec 18 01:02:55 CET 2015 on sn-devel-144 (cherry picked from commit d7feb1879ee711598540049c2c5eccc80fd6f1e5)
* vfs_streams_xattr: fix and simplify streams_xattr_get_name()Ralph Boehme2016-01-061-20/+19
| | | | | | | | | | | | | | | | | | | | streams_xattr_get_name() fails to chop off the stream type in case config->store_stream_type is false and the passed stream name contains a stream type. Eg when the passed in stream name is ":mystream:$DATA", but config->store_stream_type is false, we must generate a xattr name of "mystream" or "user.mystream". Bug: https://bugzilla.samba.org/show_bug.cgi?id=11466 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Oct 16 23:27:01 CEST 2015 on sn-devel-104 (cherry picked from commit 2881679e3ecbaf07cdd82ba65af8d55e5e3be800)
* vfs_fruit: hide the Netatalk metadata xattr in streaminfoRalph Boehme2016-01-061-2/+49
| | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=11466 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit fedd09662c889fb796135d86836c160171fac68d)
* vfs_fruit: add and use define for the Netatalk metadata xattrRalph Boehme2016-01-061-2/+3
| | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=11466 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit c8ee1a059b4484575b03ac76b469df85cdabdd9a)
* s4:torture:vfs_fruit: add test test_read_afpinfoRalph Boehme2016-01-061-0/+79
| | | | | | | | | | | This works against any SMB server and test basic IO on the AFP_AfpInfo stream. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit b165d520374cc2ae77acfd813b528e55acfc2f7e)
* s4:torture:vfs_fruit: add tests for AFP_Resource delete-on-close and eofRalph Boehme2016-01-061-0/+293
| | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 21d4b5cea8e4dec729912915d60922edaea0f418)
* vfs_fruit: ignore delete on the AFP_Resource streamRalph Boehme2016-01-061-21/+2
| | | | | | | | | | | OS X ignores deletes on the AFP_Resource stream. This was discovered by torture tests against OS X SMB server. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit ee431fc5254dc735662d152dd19a81d439ca5e44)
* s4:torture:vfs_fruit: update AFP_AfpInfo IO testsRalph Boehme2016-01-061-3/+3
| | | | | | | | | | | | | | | When reading from the AFP_AfpInfo stream, OS X ignores the offset from the request and always reads from offset=0. The offset bounds check has a off-by-1 bug in OS X, so a request offset=60 (AFP_AfpInfo stream has a ficed size of 60 bytes), len=1 returns 1 byte from offset 0 insteaf of returning 0. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit decde0b4812eba5f80b717fd2ae868558a022753)
* vfs_fruit: fix offset and len handling for AFP_AfpInfo streamRalph Boehme2016-01-061-3/+12
| | | | | | | | | | | | | | | When reading from the AFP_AfpInfo stream, OS X ignores the offset from the request and always reads from offset=0. The offset bounds check has a off-by-1 bug in OS X, so a request offset=60 (AFP_AfpInfo stream has a ficed size of 60 bytes), len=1 returns 1 byte from offset 0 insteaf of returning 0. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit f569fd5e44300ab41aa7298b3efdcac99cd330f2)
* s4:torture:vfs_fruit: test nulling out AFP_AfpInfo streamRalph Boehme2016-01-061-0/+53
| | | | | | | | | | This must delete the stream. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 666a55b7060542ef78ff5f22d368f2ebc4c3318f)
* vfs_fruit: writing all 0 to AFP_AfpInfo streamRalph Boehme2016-01-061-0/+17
| | | | | | | | | | | | When writing all 0 to AFP_AfpInfo stream we can remove the underlying storage object. This beaviour of OS X SMB server was found with a torture test. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit e94b17715ea8049df8819b472178170b8e987946)
* s4:torture:vfs_fruit: add tests for AFP_AfpInfo delete-on-close and eofRalph Boehme2016-01-061-0/+295
| | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit e5588b463ee77aac3b396774e68c10b13a9f6f04)