From 269fe99a62371fb9540d886f7cc619450c5b5c8d Mon Sep 17 00:00:00 2001 From: Nadezhda Ivanova Date: Thu, 3 Sep 2009 14:39:40 +0300 Subject: Added "admin_session" method. The purpose of admin_session is to be able to execute parts of provisioning as the user Administrator in order to have the correct group and owner in the security descriptors. To be used for provisioning and tests only. --- source4/scripting/python/samba/provision.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source4/scripting/python') diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py index 27b5369ea1..778271f1d5 100644 --- a/source4/scripting/python/samba/provision.py +++ b/source4/scripting/python/samba/provision.py @@ -40,7 +40,7 @@ import subprocess import shutil from credentials import Credentials, DONT_USE_KERBEROS -from auth import system_session +from auth import system_session, admin_session from samba import version, Ldb, substitute_var, valid_netbios_name, check_all_substituted, \ DS_BEHAVIOR_WIN2008 from samba.samdb import SamDB @@ -863,6 +863,10 @@ def setup_samdb(path, setup_path, session_info, credentials, lp, else: domain_oc = "samba4LocalDomain" +#impersonate domain admin + admin_session_info = admin_session(lp, str(domainsid)) + samdb.set_session_info(admin_session_info) + setup_add_ldif(samdb, setup_path("provision_basedn.ldif"), { "DOMAINDN": names.domaindn, "DOMAIN_OC": domain_oc -- cgit