mirror of
https://github.com/samba-team/samba.git
synced 2025-12-10 04:23:50 +03:00
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>
This commit is contained in:
committed by
Karolin Seeger
parent
21d501bfa8
commit
6048103751
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user