diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-08-17 17:48:27 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-08-17 17:48:27 +1000 |
commit | 52108a19a4130af0c241794898c61bf425b914e5 (patch) | |
tree | 59a2169b137a81eae10372e8a4782ab9dc7887b3 /source4/scripting/python/samba/provision.py | |
parent | 905db3288532131171ca1c54198660d86eef1ae9 (diff) | |
download | samba-52108a19a4130af0c241794898c61bf425b914e5.tar.gz samba-52108a19a4130af0c241794898c61bf425b914e5.tar.xz samba-52108a19a4130af0c241794898c61bf425b914e5.zip |
fixed up add_foreign again
my last patch was not even close ...
I'll leave abartlet to work out how to fix the test case
Diffstat (limited to 'source4/scripting/python/samba/provision.py')
-rw-r--r-- | source4/scripting/python/samba/provision.py | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py index 026e85dfdc..e2abb05f68 100644 --- a/source4/scripting/python/samba/provision.py +++ b/source4/scripting/python/samba/provision.py @@ -474,18 +474,30 @@ def setup_name_mappings(samdb, idmap, sid, domaindn, root_uid, nobody_uid, :param users_gid: gid of the UNIX users group. :param wheel_gid: gid of the UNIX wheel group.""" -def add_foreign(self, domaindn, sid, desc): - """Add a foreign security principle.""" - add = """ + def add_foreign(self, domaindn, sid, desc): + """Add a foreign security principle.""" + add = """ dn: CN=%s,CN=ForeignSecurityPrincipals,%s objectClass: top objectClass: foreignSecurityPrincipal description: %s """ % (sid, domaindn, desc) - # deliberately ignore errors from this, as the records may - # already exist - for msg in self.parse_ldif(add): - self.add(msg[1]) + # deliberately ignore errors from this, as the records may + # already exist + for msg in self.parse_ldif(add): + self.add(msg[1]) + + add_foreign(samdb, self.domaindn, "S-1-5-7", "Anonymous") + add_foreign(samdb, self.domaindn, "S-1-1-0", "World") + add_foreign(samdb, self.domaindn, "S-1-5-2", "Network") + add_foreign(samdb, self.domaindn, "S-1-5-18", "System") + add_foreign(samdb, self.domaindn, "S-1-5-11", "Authenticated Users") + + idmap.setup_name_mapping("S-1-5-7", idmap.TYPE_UID, nobody_uid) + idmap.setup_name_mapping("S-1-5-32-544", idmap.TYPE_GID, wheel_gid) + + idmap.setup_name_mapping(sid + "-500", idmap.TYPE_UID, root_uid) + idmap.setup_name_mapping(sid + "-513", idmap.TYPE_GID, users_gid) def setup_samdb_partitions(samdb_path, setup_path, message, lp, session_info, credentials, names, |