From 70de501d6a628e8b08a93134753e25e9f037c995 Mon Sep 17 00:00:00 2001 From: Geza Gemes Date: Thu, 12 Jul 2012 16:05:04 +0200 Subject: s4-provision: Provide YP/NIS subtree to allow ADUC to see and set rfc2307 attrs When provisioning with --use_rfc2307=yes populate the subtree: CN=ypServ30,CN=RpcServices,CN=System,${DOMAINDN} This makes it possible to manipulate the posix attributes via ADUC (commit message adjusted by abartlet) Signed-off-by: Andrew Bartlett --- .../scripting/python/samba/provision/__init__.py | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'source4/scripting/python') diff --git a/source4/scripting/python/samba/provision/__init__.py b/source4/scripting/python/samba/provision/__init__.py index d9d1ce9eab..192130ea1c 100644 --- a/source4/scripting/python/samba/provision/__init__.py +++ b/source4/scripting/python/samba/provision/__init__.py @@ -1590,6 +1590,27 @@ def sanitize_server_role(role): except KeyError: raise ValueError(role) +def provision_fake_ypserver(logger, samdb, domaindn, netbiosname, nisdomain, maxuid, maxgid): + """Creates AD entries for the fake ypserver + needed for being able to manipulate posix attrs via ADUC + """ + samdb.transaction_start() + try: + logger.info("Setting up fake yp server settings") + setup_add_ldif(samdb, setup_path("ypServ30.ldif"), { + "DOMAINDN": domaindn, + "NETBIOSNAME": netbiosname, + "NISDOMAIN": nisdomain, + }) + except Exception: + samdb.transaction_cancel() + raise + else: + samdb.transaction_commit() + if maxuid != None: + pass + if maxgid != None: + pass def provision(logger, session_info, credentials, smbconf=None, targetdir=None, samdb_fill=FILL_FULL, realm=None, rootdn=None, @@ -1605,7 +1626,7 @@ def provision(logger, session_info, credentials, smbconf=None, ol_mmr_urls=None, ol_olc=None, slapd_path="/bin/false", useeadb=False, am_rodc=False, lp=None, use_ntvfs=False, - use_rfc2307=False): + use_rfc2307=False, maxuid=None, maxgid=None): """Provision samba4 :note: caution, this wipes all existing data! @@ -1898,6 +1919,10 @@ def provision(logger, session_info, credentials, smbconf=None, result.backend_result = backend_result + if use_rfc2307: + provision_fake_ypserver(logger=logger, samdb=samdb, domaindn=names.domaindn, netbiosname=names.netbiosname, + nisdomain=(names.domain).lower(), maxuid=maxuid, maxgid=maxgid) + return result -- cgit