Esempio n. 1
0
 def setUp(self):
     #
     # If you don't enable SeSecurity, you won't be able to
     # read SACL in this process.
     #
     testutils.change_priv(win32security.SE_SECURITY_NAME, True)
     self.GUID = str(uuid.uuid1())
     self.TEST_ROOT = tempfile.mkdtemp(prefix="winsys-")
     assert os.path.isdir(self.TEST_ROOT)
Esempio n. 2
0
 def setUp(self):
     #
     # If you don't enable SeSecurity, you won't be able to
     # read SACL in this process.
     #
     testutils.change_priv(win32security.SE_SECURITY_NAME, True)
     self.GUID = str(uuid.uuid1())
     self.TEST_ROOT = tempfile.mkdtemp(prefix="winsys-")
     assert os.path.isdir(self.TEST_ROOT)
Esempio n. 3
0
 def setUp (self):
   utils.change_priv (win32security.SE_SECURITY_NAME, True)
   self.filehandle, self.filename = tempfile.mkstemp ()
   dacl = win32security.ACL ()
   dacl.AddAccessAllowedAceEx (win32security.ACL_REVISION_DS, 0, ntsecuritycon.FILE_READ_DATA, everyone)
   sacl = win32security.ACL ()
   sacl.AddAuditAccessAce (win32security.ACL_REVISION_DS, ntsecuritycon.FILE_READ_DATA, everyone, 1, 1)
   win32security.SetNamedSecurityInfo (
     self.filename, win32security.SE_FILE_OBJECT,
     win32security.DACL_SECURITY_INFORMATION | win32security.SACL_SECURITY_INFORMATION,
     None, None, dacl, sacl
   )
Esempio n. 4
0
 def setUp(self):
     testutils.change_priv(win32security.SE_SECURITY_NAME, True)
     self.filehandle, self.filename = tempfile.mkstemp()
     dacl = win32security.ACL()
     dacl.AddAccessAllowedAceEx(win32security.ACL_REVISION_DS, 0,
                                ntsecuritycon.FILE_READ_DATA, everyone)
     sacl = win32security.ACL()
     sacl.AddAuditAccessAce(win32security.ACL_REVISION_DS,
                            ntsecuritycon.FILE_READ_DATA, everyone, 1, 1)
     win32security.SetNamedSecurityInfo(
         self.filename, win32security.SE_FILE_OBJECT,
         win32security.DACL_SECURITY_INFORMATION
         | win32security.SACL_SECURITY_INFORMATION, None, None, dacl, sacl)
Esempio n. 5
0
 def setUp(self):
     #
     # If you don't enable SeSecurity, you won't be able to
     # read SACL in this process.
     #
     utils.change_priv(win32security.SE_SECURITY_NAME, True)
     self.GUID = str(uuid.uuid1())
     self.TEST_ROOT = tempfile.mkdtemp(prefix="winsys-")
     assert os.path.isdir(self.TEST_ROOT)
     sacl = win32security.ACL()
     sid, _, _ = win32security.LookupAccountName(None,
                                                 win32api.GetUserName())
     sacl.AddAuditAccessAceEx(
         win32security.ACL_REVISION_DS, win32security.OBJECT_INHERIT_ACE
         | win32security.CONTAINER_INHERIT_ACE,
         ntsecuritycon.FILE_ALL_ACCESS, sid, 1, 1)
     win32security.SetNamedSecurityInfo(
         self.TEST_ROOT, win32security.SE_FILE_OBJECT,
         win32security.SACL_SECURITY_INFORMATION, None, None, None, sacl)
Esempio n. 6
0
 def tearDown(self):
     os.close(self.filehandle)
     os.unlink(self.filename)
     testutils.change_priv(win32security.SE_SECURITY_NAME, False)
Esempio n. 7
0
 def tearDown (self):
   os.close (self.filehandle)
   os.unlink (self.filename)
   utils.change_priv (win32security.SE_SECURITY_NAME, False)