mirror of
https://github.com/samba-team/samba.git
synced 2025-07-29 15:42:04 +03:00
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>
This commit is contained in:
committed by
Andrew Bartlett
parent
5a9ce8b94a
commit
70de501d6a
@ -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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user