summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatoliy Atanasov <anatoliy.atanasov@postpath.com>2010-05-17 12:49:37 +0300
committerAnatoliy Atanasov <anatoliy.atanasov@postpath.com>2010-05-17 13:30:27 +0300
commitd040658e1a5a48c6cc33640de37771d601c69a76 (patch)
treef4b99f0c2312cd12ac2cba46e9826c43483e5870
parent26d41c23f69b9e3ee327f159c9164917422d45c5 (diff)
downloadsamba-d040658e1a5a48c6cc33640de37771d601c69a76.tar.gz
samba-d040658e1a5a48c6cc33640de37771d601c69a76.tar.bz2
samba-d040658e1a5a48c6cc33640de37771d601c69a76.zip
s4-rodc: Set am_rodc flag during provision
-rw-r--r--source4/scripting/python/samba/provision.py18
-rw-r--r--source4/scripting/python/samba/samdb.py5
-rw-r--r--source4/scripting/python/samba/schema.py4
3 files changed, 16 insertions, 11 deletions
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py
index f7db2e7bb8..b4e48fbc95 100644
--- a/source4/scripting/python/samba/provision.py
+++ b/source4/scripting/python/samba/provision.py
@@ -841,7 +841,7 @@ def setup_samdb(path, setup_path, session_info, provision_backend, lp,
domainsid, domainguid, policyguid, policyguid_dc,
fill, adminpass, krbtgtpass,
machinepass, invocationid, dnspass, ntdsguid,
- serverrole, dom_for_fun_level=None,
+ serverrole, am_rodc, dom_for_fun_level=None,
schema=None):
"""Setup a complete SAM Database.
@@ -870,11 +870,13 @@ def setup_samdb(path, setup_path, session_info, provision_backend, lp,
names=names, serverrole=serverrole, schema=schema)
if schema is None:
- schema = Schema(setup_path, domainsid, schemadn=names.schemadn, serverdn=names.serverdn)
+ schema = Schema(setup_path, domainsid, schemadn=names.schemadn, serverdn=names.serverdn,
+ am_rodc=am_rodc)
# Load the database, but don's load the global schema and don't connect quite yet
samdb = SamDB(session_info=session_info, url=None, auto_connect=False,
- credentials=provision_backend.credentials, lp=lp, global_schema=False)
+ credentials=provision_backend.credentials, lp=lp, global_schema=False,
+ am_rodc=am_rodc)
message("Pre-loading the Samba 4 and AD schema")
@@ -960,7 +962,7 @@ def setup_samdb(path, setup_path, session_info, provision_backend, lp,
samdb = SamDB(session_info=admin_session_info,
credentials=provision_backend.credentials, lp=lp,
- global_schema=False)
+ global_schema=False, am_rodc=am_rodc)
samdb.connect(path)
samdb.transaction_start()
try:
@@ -1116,7 +1118,7 @@ def provision(setup_dir, message, session_info,
sitename=None,
ol_mmr_urls=None, ol_olc=None,
setup_ds_path=None, slapd_path=None, nosync=False,
- ldap_dryrun_mode=False,useeadb=False):
+ ldap_dryrun_mode=False,useeadb=False, am_rodc=False):
"""Provision samba4
:note: caution, this wipes all existing data!
@@ -1237,8 +1239,8 @@ def provision(setup_dir, message, session_info,
ldapi_url = "ldapi://%s" % urllib.quote(paths.s4_ldapi_path, safe="")
schema = Schema(setup_path, domainsid, invocationid=invocationid, schemadn=names.schemadn,
- serverdn=names.serverdn)
-
+ serverdn=names.serverdn, am_rodc=am_rodc)
+
if backend_type == "ldb":
provision_backend = LDBBackend(backend_type,
paths=paths, setup_path=setup_path,
@@ -1324,7 +1326,7 @@ def provision(setup_dir, message, session_info,
invocationid=invocationid,
machinepass=machinepass, dnspass=dnspass,
ntdsguid=ntdsguid, serverrole=serverrole,
- dom_for_fun_level=dom_for_fun_level)
+ dom_for_fun_level=dom_for_fun_level, am_rodc=am_rodc)
if serverrole == "domain controller":
if paths.netlogon is None:
diff --git a/source4/scripting/python/samba/samdb.py b/source4/scripting/python/samba/samdb.py
index 991c678c7c..4af330b906 100644
--- a/source4/scripting/python/samba/samdb.py
+++ b/source4/scripting/python/samba/samdb.py
@@ -37,7 +37,8 @@ class SamDB(samba.Ldb):
"""The SAM database."""
def __init__(self, url=None, lp=None, modules_dir=None, session_info=None,
- credentials=None, flags=0, options=None, global_schema=True, auto_connect=True):
+ credentials=None, flags=0, options=None, global_schema=True, auto_connect=True,
+ am_rodc=False):
self.lp = lp
if not auto_connect:
url = None
@@ -51,6 +52,8 @@ class SamDB(samba.Ldb):
if global_schema:
dsdb.dsdb_set_global_schema(self)
+ dsdb.dsdb_set_am_rodc(self, am_rodc)
+
def connect(self, url=None, flags=0, options=None):
if self.lp is not None:
url = self.lp.private_path(url)
diff --git a/source4/scripting/python/samba/schema.py b/source4/scripting/python/samba/schema.py
index 1777c6559c..562fe3891d 100644
--- a/source4/scripting/python/samba/schema.py
+++ b/source4/scripting/python/samba/schema.py
@@ -54,7 +54,7 @@ def get_schema_descriptor(domain_sid):
class Schema(object):
def __init__(self, setup_path, domain_sid, invocationid=None, schemadn=None,
- serverdn=None, files=None, prefixmap=None):
+ serverdn=None, files=None, prefixmap=None, am_rodc=False):
"""Load schema for the SamDB from the AD schema files and samba4_schema.ldif
:param samdb: Load a schema into a SamDB.
@@ -66,7 +66,7 @@ class Schema(object):
"""
self.schemadn = schemadn
- self.ldb = SamDB(global_schema=False)
+ self.ldb = SamDB(global_schema=False, am_rodc=am_rodc)
if serverdn is not None:
self.ldb.set_ntds_settings_dn("CN=NTDS Settings,%s" % serverdn)
if invocationid is not None: