summaryrefslogtreecommitdiff
path: root/python/samba/tests/posixacl.py
diff options
context:
space:
mode:
authorTim Beale <timbeale@catalyst.net.nz>2019-03-15 15:20:21 +1300
committerKarolin Seeger <kseeger@samba.org>2019-04-08 10:27:34 +0000
commit6048103751afa33f1951539ce36224a03b276604 (patch)
tree92c802534a2006eb439d7a7ed68564000f458f74 /python/samba/tests/posixacl.py
parent21d501bfa8f66d98d2b5dfd3ffa2a9dd07af5dbd (diff)
downloadsamba-6048103751afa33f1951539ce36224a03b276604.tar.gz
CVE-2019-3870 tests: Extend smbd tests to check for umask being overwritten
The smbd changes the umask - if the code fails to restore the umask to what it was, then this is very bad. Add an extra check to every smbd-related test that the umask at the end of the test is the same as what it was at the beginning (i.e. if the smbd code changed the umask then it correctly restored the value afterwards). As the selftest sets the umask for all tests to zero, it makes it hard to detect this problem, so the test setUp() needs to set it to something else first. This extra checking is added to the setUp()/tearDown() so that it applies to all test-cases. However, any failure that occur with this approach will not be able to be known-failed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13834 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'python/samba/tests/posixacl.py')
-rw-r--r--python/samba/tests/posixacl.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/samba/tests/posixacl.py b/python/samba/tests/posixacl.py
index 65ca2c846f5..7e1fb3ec55e 100644
--- a/python/samba/tests/posixacl.py
+++ b/python/samba/tests/posixacl.py
@@ -20,7 +20,7 @@
from samba.ntacls import setntacl, getntacl, checkset_backend
from samba.dcerpc import security, smb_acl, idmap
-from samba.tests import TestCaseInTempDir
+from samba.tests.smbd_base import SmbdBaseTests
from samba import provision
import os
from samba.samba3 import smbd, passdb
@@ -32,7 +32,7 @@ DOM_SID = "S-1-5-21-2212615479-2695158682-2101375467"
ACL = "O:S-1-5-21-2212615479-2695158682-2101375467-512G:S-1-5-21-2212615479-2695158682-2101375467-513D:(A;OICI;0x001f01ff;;;S-1-5-21-2212615479-2695158682-2101375467-512)"
-class PosixAclMappingTests(TestCaseInTempDir):
+class PosixAclMappingTests(SmbdBaseTests):
def setUp(self):
super(PosixAclMappingTests, self).setUp()