[PATCH 1/2] python-s4: use secrets.ldb instead of sam.ldb for reading domain SID
Matthieu Patou
mat at matws.net
Tue Jan 26 15:32:29 MST 2010
---
source4/scripting/python/samba/netcmd/ntacl.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/source4/scripting/python/samba/netcmd/ntacl.py b/source4/scripting/python/samba/netcmd/ntacl.py
index a96593e..8c0803f 100644
--- a/source4/scripting/python/samba/netcmd/ntacl.py
+++ b/source4/scripting/python/samba/netcmd/ntacl.py
@@ -61,7 +61,7 @@ class cmd_acl_set(Command):
credopts=None, sambaopts=None, versionopts=None):
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp)
- path = os.path.join(lp.get("private dir"), lp.get("sam database") or "samdb.ldb")
+ path = os.path.join(lp.get("private dir"), lp.get("secrets database") or "secrets.ldb")
creds = credopts.get_credentials(lp)
creds.set_kerberos_state(DONT_USE_KERBEROS)
try:
@@ -71,7 +71,7 @@ class cmd_acl_set(Command):
sys.exit(1)
attrs = ["objectSid"]
print lp.get("realm")
- res = ldb.search(expression="(objectClass=*)",base="DC=%s"%lp.get("realm").lower().replace(".",",DC="), scope=SCOPE_BASE, attrs=attrs)
+ res = ldb.search(expression="(objectClass=*)",base="flatname=%s,cn=Primary Domains"%lp.get("workgroup"), scope=SCOPE_BASE, attrs=attrs)
if len(res) !=0:
domainsid = ndr_unpack( security.dom_sid,res[0]["objectSid"][0])
setntacl(lp,file,acl,str(domainsid),xattr_backend,eadb_file)
--
1.6.3.3
--------------010401010709070503080204
Content-Type: text/x-patch;
name="0002-provision-Use-short-name-for-assignee.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="0002-provision-Use-short-name-for-assignee.patch"
More information about the samba-technical
mailing list