s4:samba-tool/gpo: set the same security.descriptor type as the Windows GUI
authorStefan Metzmacher <metze@samba.org>
Thu, 29 Nov 2012 08:57:44 +0000 (09:57 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 29 Jan 2013 21:03:20 +0000 (22:03 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source4/scripting/python/samba/netcmd/gpo.py

index 23b562eb6358fba17dd5151203ff4ca67c2ea1d7..675b7b2e29105fce6915ac698d329580b22bf41c 100644 (file)
@@ -986,8 +986,12 @@ class cmd_create(Command):
 
             # Create a file system security descriptor
             domain_sid = security.dom_sid(self.samdb.get_domain_sid())
-            sddl = dsacl2fsacl(ds_sd, domain_sid)
-            fs_sd = security.descriptor.from_sddl(sddl, domain_sid)
+            fs_sd = dsacl2fsacl(ds_sd, domain_sid, as_sddl=False)
+            fs_sd.type = security.SEC_DESC_SELF_RELATIVE
+            fs_sd.type |= security.SEC_DESC_DACL_PROTECTED
+            fs_sd.type |= security.SEC_DESC_DACL_AUTO_INHERITED
+            fs_sd.type |= security.SEC_DESC_DACL_AUTO_INHERIT_REQ
+            fs_sd.type |= security.SEC_DESC_SACL_AUTO_INHERITED
 
             # Copy GPO directory
             create_directory_hier(conn, sharepath)