summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorGeza Gemes <geza@kzsdabas.hu>2012-07-12 16:05:04 +0200
committerAndrew Bartlett <abartlet@samba.org>2012-07-13 06:00:17 +0200
commit70de501d6a628e8b08a93134753e25e9f037c995 (patch)
tree7f617169e85c3e9cd1f949b1f663ff60b7addd22 /source4/scripting
parent5a9ce8b94acf201ddb3d8e34dd962955284f1c5f (diff)
downloadsamba-70de501d6a628e8b08a93134753e25e9f037c995.tar.gz
samba-70de501d6a628e8b08a93134753e25e9f037c995.tar.bz2
samba-70de501d6a628e8b08a93134753e25e9f037c995.zip
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 <abartlet@samba.org>
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/samba/provision/__init__.py27
1 files changed, 26 insertions, 1 deletions
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