diff options
author | Nadezhda Ivanova <nadezhda.ivanova@postpath.com> | 2009-09-03 14:39:40 +0300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-09-09 18:57:50 +1000 |
commit | 269fe99a62371fb9540d886f7cc619450c5b5c8d (patch) | |
tree | cca34fdf18826ed84e13088f1448fde1ec3f1307 /source4/scripting/python | |
parent | 8640293fabb0fd0fe92b814411577dcdb449100d (diff) | |
download | samba-269fe99a62371fb9540d886f7cc619450c5b5c8d.tar.gz samba-269fe99a62371fb9540d886f7cc619450c5b5c8d.tar.bz2 samba-269fe99a62371fb9540d886f7cc619450c5b5c8d.zip |
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.
Diffstat (limited to 'source4/scripting/python')
-rw-r--r-- | source4/scripting/python/samba/provision.py | 6 |
1 files changed, 5 insertions, 1 deletions
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 |