summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* VERSION: Bump version up to 4.12.16.v4-12-testKarolin Seeger2021-04-291-1/+1
| | | | Signed-off-by: Karolin Seeger <kseeger@samba.org>
* Merge tag 'samba-4.12.15' into v4-12-testKarolin Seeger2021-04-292-24/+184
|\ | | | | | | samba: tag release samba-4.12.15
| * VERSION: Disable GIT_SNAPSHOT for the 4.12.15 release.samba-4.12.15v4-12-stableKarolin Seeger2021-04-261-1/+1
| | | | | | | | | | | | BUG 14571: CVE-2021-20254: Buffer overrun in sids_to_unixids(). Signed-off-by: Karolin Seeger <kseeger@samba.org>
| * WHATSNEW: Add release notes for Samba 4.12.15.Karolin Seeger2021-04-261-2/+66
| | | | | | | | Signed-off-by: Karolin Seeger <kseeger@samba.org>
| * CVE-2021-20254 passdb: Simplify sids_to_unixids()Volker Lendecke2021-04-261-22/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Best reviewed with "git show -b", there's a "continue" statement that changes subsequent indentation. Decouple lookup status of ids from ID_TYPE_NOT_SPECIFIED Bug: https://bugzilla.samba.org/show_bug.cgi?id=14571 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (backported from patch from master) [backport by npower@samba.org as master commit 493f5d6b078e0b0f80d1ef25043e2834cb4fcb87 and 58e9b62222ad62c81cdf11d704859a227cb2902b creates conflicts due to rename of WBC_ID_TYPE_* -> ID_TYPE_*] [backport by jra@samba.org to work around a compiler bug showing this error on gcc 5.6 -> 6.x, seen on Debian 9 and Ubuntu 16.04 under -O3: ../../source3/passdb/lookup_sid.c:1246:6: error: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Werror=strict-overflow]]
| * VERSION: Enable GIT_SNAPSHOT.Karolin Seeger2021-04-261-1/+1
| | | | | | | | Signed-off-by: Karolin Seeger <kseeger@samba.org>
| * VERSION: Bump version up to 4.12.15...Stefan Metzmacher2021-04-261-1/+1
| | | | | | | | | | | | | | GIT_SNAPSHOT is already 'yes'. Signed-off-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit deb7b32b4372625211a4d6ba26e3d00223e903ca)
* | VERSION: Bump version up to 4.12.15...Stefan Metzmacher2021-03-241-1/+1
| | | | | | | | | | | | GIT_SNAPSHOT is already 'yes'. Signed-off-by: Stefan Metzmacher <metze@samba.org>
* | Merge branch 'v4-12-stable' (samba-4.12.14) into 'v4-12-test'Stefan Metzmacher2021-03-249-15/+589
|\ \ | |/ | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
| * WHATSNEW: Add release notes for Samba 4.12.14.Karolin Seeger2021-03-241-2/+62
| | | | | | | | Signed-off-by: Karolin Seeger <kseeger@samba.org>
| * VERSION: Bump version for Samba 4.12.14 release.samba-4.12.14Stefan Metzmacher2021-03-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | o BUG #14595: CVE-2020-27840: Heap corruption via crafted DN strings. o BUG #14655: CVE-2021-20277: Out of bounds read in AD DC LDAP server. Note this is exactly the same as 4.12.13, except that it has a dependency on ldb version 2.1.5, which is needed if someone builds against a system libldb. Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Karolin Seeger <kseeger@samba.org>
| * ldb: version 2.1.5ldb-2.1.5Stefan Metzmacher2021-03-243-1/+287
| | | | | | | | | | | | | | | | o BUG #14595: CVE-2020-27840: Heap corruption via crafted DN strings. o BUG #14655: CVE-2021-20277: Out of bounds read in AD DC LDAP server. Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Karolin Seeger <kseeger@samba.org>
| * VERSION: Disable GIT_SNAPSHOT for the Samba 4.12.13 release.samba-4.12.13Karolin Seeger2021-03-232-2/+2
| | | | | | | | | | | | | | o BUG #14595: CVE-2020-27840: Heap corruption via crafted DN strings. o BUG #14655: CVE-2021-20277: Out of bounds read in AD DC LDAP server. Signed-off-by: Karolin Seeger <kseeger@samba.org>
| * WHATSNEW: Add release notes for Samba 4.12.13.Karolin Seeger2021-03-231-2/+65
| | | | | | | | Signed-off-by: Karolin Seeger <kseeger@samba.org>
| * CVE-2020-27840: pytests: move Dn.validate test to ldbDouglas Bagnall2021-03-223-6/+46
| | | | | | | | | | | | | | | | | | | | | | | | We had the test in the Samba Python segfault suite because a) the signal catching infrastructure was there, and b) the ldb tests lack Samba's knownfail mechanism, which allowed us to assert the failure. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14595 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
| * CVE-2020-27840 ldb_dn: avoid head corruption in ldb_dn_explodeDouglas Bagnall2021-03-222-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A DN string with lots of trailing space can cause ldb_dn_explode() to put a zero byte in the wrong place in the heap. When a DN string has a value represented with trailing spaces, like this "CN=foo ,DC=bar" the whitespace is supposed to be ignored. We keep track of this in the `t` pointer, which is NULL when we are not walking through trailing spaces, and points to the first space when we are. We are walking with the `p` pointer, writing the value to `d`, and keeping the length in `l`. "CN=foo ,DC= " ==> "foo " ^ ^ ^ t p d --l--- The value is finished when we encounter a comma or the end of the string. If `t` is not NULL at that point, we assume there are trailing spaces and wind `d and `l` back by the correct amount. Then we switch to expecting an attribute name (e.g. "CN"), until we get to an "=", which puts us back into looking for a value. Unfortunately, we forget to immediately tell `t` that we'd finished the last value, we can end up like this: "CN=foo ,DC= " ==> "" ^ ^ ^ t p d l=0 where `p` is pointing to a new value that contains only spaces, while `t` is still referring to the old value. `p` notices the value ends, and we subtract `p - t` from `d`: "CN=foo ,DC= " ==> ? "" ^ ^ ^ t p d l ~= SIZE_MAX - 8 At that point `d` wants to terminate its string with a '\0', but instead it terminates someone else's byte. This does not crash if the number of trailing spaces is small, as `d` will point into a previous value (a copy of "foo" in this example). Corrupting that value will ultimately not matter, as we will soon try to allocate a buffer `l` long, which will be greater than the available memory and the whole operation will fail properly. However, with more spaces, `d` will point into memory before the beginning of the allocated buffer, with the exact offset depending on the length of the earlier attributes and the number of spaces. What about a longer DN with more attributes? For example, "CN=foo ,DC= ,DC=example,DC=com" -- since `d` has moved out of bounds, won't we continue to use it and write more DN values into mystery memory? Fortunately not, because the aforementioned allocation of `l` bytes must happen first, and `l` is now huge. The allocation happens in a talloc_memdup(), which is by default restricted to allocating 256MB. So this allows a person who controls a string parsed by ldb_dn_explode to corrupt heap memory by placing a single zero byte at a chosen offset before the allocated buffer. An LDAP bind request can send a string DN as a username. This DN is necessarily parsed before the password is checked, so an attacker does not need proper credentials. The attacker can easily cause a denial of service and we cannot rule out more subtle attacks. The immediate solution is to reset `t` to NULL when a comma is encountered, indicating that we are no longer looking at trailing whitespace. Found with the help of Honggfuzz. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14595 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
| * CVE-2020-27840: pytests:segfault: add ldb.Dn validate testDouglas Bagnall2021-03-222-0/+7
| | | | | | | | | | | | | | | | | | ldb.Dn.validate wraps ldb_dn_explode. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14595 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
| * CVE-2021-20277 ldb/attrib_handlers casefold: stay in boundsDouglas Bagnall2021-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | For a string that had N spaces at the beginning, we would try to move N bytes beyond the end of the string. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14655 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry-picked from commit for master)
| * CVE-2021-20277 ldb: Remove tests from ldb_match_test that do not passAndrew Bartlett2021-03-221-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts some of the backport of 33a95a1e75b85e9795c4490b78ead2162e2a1f47 This is done here rather than squashed in the cherry-pick of the expanded testsuite because it allows this commit to be simply reverted for the backport of bug 14044 if this lands first, or to be dropped if bug 14044 lands first. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14655 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
| * CVE-2021-20277 ldb tests: ldb_match tests with extra spacesDouglas Bagnall2021-03-221-1/+7
| | | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14655 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry-picked from commit for master)
| * ldb: add tests for ldb_wildcard_compareDouglas Bagnall2021-03-221-10/+124
| | | | | | | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14044 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Björn Jacke <bjacke@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry-picked from commit 33a95a1e75b85e9795c4490b78ead2162e2a1f47)
| * WHATSNEW: Fix typo.Karolin Seeger2021-03-221-1/+1
| | | | | | | | | | | | | | | | | | Signed-off-by: Karolin Seeger <kseeger@samba.org> Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-12-test): Fri Mar 12 08:40:58 UTC 2021 on sn-devel-184 (cherry picked from commit c464af42449432e67755b4c257629ef1414d54d0)
| * VERSION: Bump version up to 4.12.13...Karolin Seeger2021-03-221-2/+2
| | | | | | | | | | | | | | and re-enable GIT_SNAPSHOT. Signed-off-by: Karolin Seeger <kseeger@samba.org> (cherry picked from commit 538a0a39a8027f35a625eb130309b864e70e35f1)
* | WHATSNEW: Fix typo.Karolin Seeger2021-03-121-1/+1
| | | | | | | | | | | | | | Signed-off-by: Karolin Seeger <kseeger@samba.org> Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-12-test): Fri Mar 12 08:40:58 UTC 2021 on sn-devel-184
* | VERSION: Bump version up to 4.12.13...Karolin Seeger2021-03-111-2/+2
|/ | | | | | and re-enable GIT_SNAPSHOT. Signed-off-by: Karolin Seeger <kseeger@samba.org>
* VERSION: Disable GIT_SNAPSHOT for the 4.12.12 release.samba-4.12.12Karolin Seeger2021-03-111-1/+1
| | | | Signed-off-by: Karolin Seeger <kseeger@samba.org>
* WHATSNEW: Add release notes for Samba 4.12.12.Karolin Seeger2021-03-111-2/+74
| | | | Signed-off-by: Karolin Seeger <kseeger@samba.org>
* Revert "wscript: use --as-needed only if tested successfully"Karolin Seeger2021-03-111-2/+1
| | | | This reverts commit c63f00801cae16a855aa5283fa0cc449e84577ce.
* g_lock: Fix uninitalized variable readsVolker Lendecke2021-03-081-2/+2
| | | | | | | | | | | | | | | | | | If dbwrap_watched_watch_recv() returns IO_TIMEOUT, "blockerdead" might be an uninitialized non-false, and further down we'll remove the wrong exclusive locker. Bug: https://bugzilla.samba.org/show_bug.cgi?id=14636 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): Fri Mar 5 11:22:07 UTC 2021 on sn-devel-184 (cherry picked from commit 654c18a244f060d81280493a324b98602a69dbbf) Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-12-test): Mon Mar 8 08:51:39 UTC 2021 on sn-devel-184
* locking: Fix an uninitialized variable readVolker Lendecke2021-03-081-1/+1
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=14636 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 84b634c613352fc1da8e1525d72597c526d534d2)
* s3:modules:vfs_virusfilter: Recent talloc changes cause infinite start-up ↵Trever L. Adams2021-03-051-67/+90
| | | | | | | | | | | | | | | | | | | failure Recent talloc changes cause the current check for failure to allocate to be incorrectly triggered. This patch checks to see if the original parameter to be checked for NULL if the talloc returns NULL. This allows for rapid passing in the ca BUG: https://bugzilla.samba.org/show_bug.cgi?id=14634 RN: Fix failure of vfs_virusfilter starting due to talloc changes Signed-off-by: Trever L. Adams" <trever.adams@gmail.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <noel.power@suse.com> (cherry picked from commit 5a92810082c9a9d2833946ae0d83ce05a6bde597) Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-12-test): Fri Mar 5 13:17:14 UTC 2021 on sn-devel-184
* wscript: use --as-needed only if tested successfullyBjörn Jacke2021-03-051-1/+2
| | | | | | | | | | Some OSes like Solaris based OmiOS don't support this. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14288 Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 996560191ac6bd603901dcd6c0de5d239e019ef4)
* s3: VFS: nfs4_acls. Add missing TALLOC_FREE(frame) in error path.Peter Eriksson2021-03-031-0/+1
| | | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14648 Signed-off-by: Peter Eriksson <pen@lysator.liu.se> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Mulder <dmulder@samba.org> Autobuild-User(master): David Mulder <dmulder@samba.org> Autobuild-Date(master): Thu Feb 25 20:46:02 UTC 2021 on sn-devel-184 (cherry picked from commit 3d91fe071a29e2e0c54a10ba081a46cb5c324585) Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-12-test): Wed Mar 3 11:11:28 UTC 2021 on sn-devel-184
* script/autobuild.py: let cleanup() ignore errors from rmdir_force() by defaultStefan Metzmacher2021-03-031-3/+12
| | | | | | | | | | | | | | | It's not useful to generate a python backtrace from within the cleanup code. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14628 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 9883ac45939f253a63f3ff312fc3912c5f02cdac) Autobuild-User(v4-14-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-14-test): Tue Feb 2 10:29:44 UTC 2021 on sn-devel-184 (cherry picked from commit cc1568be4d4250390a9ad03c84f5e260fc7acffd)
* script/autobuild.py: split out a rmdir_force() helper functionStefan Metzmacher2021-03-031-7/+18
| | | | | | | | | | | | That also tries to re-add write permissions before removing. In future we'll have jobs changing there directory to read-only. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14628 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 7a5df2deaaf62a7edd7c64251f75ab15abe94c07) (cherry picked from commit c933135969be29072971f96481b05f499fd48b57)
* script/autobuild.py: allow write_system_info commands to failStefan Metzmacher2021-03-031-1/+4
| | | | | | | | | | | | | | These commands are just there as hints to debug possible problems. In order to support autobuild.py on non-linux platforms we should just ignore errors here. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Apr 2 07:36:07 UTC 2020 on sn-devel-184 (cherry picked from commit 9b1e96197e0983a16e73ce351eac7775801736d8)
* script/autobuild.py: use more portable 'cp -R -a -l'Stefan Metzmacher2021-03-031-1/+1
| | | | | | | | | | On platforms like FreeBSD 12 cp doesn't accept the long options, using the one letter options works there and keeps working on Linux as well. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 0312a10e09d8dc1295a4a80493761e91031e88e7)
* script/autobuild.py: add support git worktreeStefan Metzmacher2021-03-031-1/+1
| | | | | | | | .git is not always a directory, with 'git worktree' it's a file. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit f9374d0a4ecc11acc46884feec28d138accc6dab)
* classicupgrade: treat old never expires value rightBjörn Jacke2021-02-161-1/+1
| | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14624 Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Feb 10 15:06:49 UTC 2021 on sn-devel-184 (cherry picked from commit df75d82c9de6977c466ee9f01886cb012a9c5fef) Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-12-test): Tue Feb 16 22:33:52 UTC 2021 on sn-devel-184
* s3:pysmbd: fix fd leak in py_smbd_create_file()Stefan Metzmacher2021-02-161-0/+3
| | | | | | | | | | Various 'samba-tool domain backup' commands use this and will fail if there's over ~1000 files in the sysvol folder. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13898 Signed-off-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit d8fa464a2dfb11df4e1db4ebffe8bd28ff118c75)
* HEIMDAL: krb5_storage_free(NULL) should workPaul Wise2021-02-161-0/+2
| | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12505 Signed-off-by: Paul Wise <pabs3@bonedaddy.net> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Original-author: Nicolas Williams <nico@twosigma.com> (cherry-picked from heimdal commit b3db07d5f0e03f6a1a0a392e70f9675e19a6d6af) (cherry picked from commit f9ed4f7028a5ed29026ac8ef1b47b63755ba98f8)
* lib:util: Avoid free'ing our own pointerAndreas Schneider2021-02-052-5/+15
| | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14625 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 0bdbe50fac680be3fe21043246b8c75005611351) Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-12-test): Fri Feb 5 12:14:09 UTC 2021 on sn-devel-184
* lib:util: Add cache oversize test for memcacheAndreas Schneider2021-02-052-0/+40
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14625 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 00543ab3b29e3fbfe8314e51919629803e14ede6)
* lib:util: Add basic memcache unit testAndreas Schneider2021-02-053-1/+131
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14625 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit bebbf621d6052f797c5cf19a2a9bbc13e699d3f0)
* s3: libsmb: cli_state_save_tcon(). Don't deepcopy tcon struct when ↵Jeremy Allison2021-02-052-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | temporarily swapping out a connection on a cli_state. This used to make a deep copy of either cli->smb2.tcon or cli->smb1.tcon, but this leaves the original tcon pointer in place which will then get TALLOC_FREE()'d when the new tree connection is made on this cli_state. As there may be pipes open on the old tree connection with talloc'ed state allocated using the original tcon pointer as a talloc parent we can't deep copy and then free this pointer as that will fire the destructors on the pipe memory and mark them as not connected. This call is used to temporarily swap out a tcon pointer (whilst keeping existing pipes open) to allow a new tcon on the same cli_state and all users correctly call cli_state_restore_tcon() once they are finished with the new tree connection. Just return the existing pointer and set the old value to NULL. We know we MUST be calling cli_state_restore_tcon() below to restore the original tcon tree connection pointer before closing the session. Remove the knownfail.d entry. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13992 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Feb 2 21:05:25 UTC 2021 on sn-devel-184 (cherry picked from commit 4f80f5f9046b64a9e5e0503b1cb54f1492c4faec)
* s3: torture: Change the SMB1-only UID-REGRESSION-TEST to do an explicit copy ↵Jeremy Allison2021-02-051-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | of the tcon struct in use. For this test only, explicitly copy the SMB1 tcon struct, don't use cli_state_save_tcon()//cli_state_restore_tcon() as these calls will soon change to just manipulate the pointer to avoid TALLOC_FREE() on the tcon struct which calls destructors on child pipe data. In SMB1 this test calls cli_tdis() twice with an invalid vuid and expects the SMB1 tcon struct to be preserved across the calls. SMB1 cli_tdis() frees cli->smb1.tcon so we must put back a deep copy into cli->smb1.tcon to be able to safely call cli_tdis() again. This is a test-only hack. Real client code uses cli_state_save_tcon()/cli_state_restore_tcon() if it needs to temporarily swap out the active tcon on a client connection. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13992 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit e93e6108837eff0cebad8dc26d055c0e1386093a)
* s3: smbtorture3: Ensure run_tcon_test() always replaces any saved tcon and ↵Jeremy Allison2021-02-051-0/+5
| | | | | | | | | | shuts down correctly even in error paths. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13992 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit f9ca91bd293e9f2710c4449c5d4f5d016a066049)
* s3: smbtorture3: Ensure we *always* replace the saved saved_tcon even in an ↵Jeremy Allison2021-02-051-1/+1
| | | | | | | | | | error condition. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13992 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit dc701959cad7bf15aa47cad6451212606520f67f)
* s3: tests: Add regression test for bug 13992.Jeremy Allison2021-02-052-0/+22
| | | | | | | | | | | | | | | | Subtle extra test. Mark as knownfail for now. '^ user1$' must appear MORE THAN ONCE, as it can read more than one share. The previous test found user1, but only once as the bug only allows reading the security descriptor for one share, and we were unlucky that the first share security descriptor returned allows user1 to read from it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13992 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit 068f4a977f0539f790809d580bf22d2362032e3d)
* s3/auth: implement "winbind:ignore domains"Ralph Boehme2021-01-281-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Under the following conditions a user from an ignored domain might be able to authenticate: - using Kerberos - successfully previous authentication so the idmap and name caches are filled - winbind not running (fwiw, winbindd is mandatory on a domain member) - nscd running with a cached getpwnam for the ignored user (otherwise auth fails because getpwnam fails) - lookup_name() function being modified to look into the name cache before contacting winbindd. Currently it talks directly to winbindd and that will check the cache. Currently, authentication will only fail because creating the local token for the user fails because an LSA lookupname RPC call fails (because winbindd is not running). All of this makes a successfull authentication unlikelly, but that is more by accident then by design. To ensures that if winbindd is not running and as such winbindd itself can not enforce the restriction, also implement the ignored domains check in the auth system as a last line of defense. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14602 RN: "winbind:ignore domains" doesn't prevent user login from trusted domain Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit df5fe2d835169161d3930acf1e9c750dd2bc64b6) Autobuild-User(v4-12-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-12-test): Thu Jan 28 10:14:02 UTC 2021 on sn-devel-184