diff options
author | Andrew Bartlett <abartlet@samba.org> | 2013-09-18 14:27:26 -0700 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2013-09-19 12:25:41 -0700 |
commit | a623359fb8a54083b81436d14b7ba022c11efb18 (patch) | |
tree | b7fbf88263da9ee7144c6c7497ee577bf2f66b52 /python/samba/drs_utils.py | |
parent | 6965f918c04328535c55a0ef9b7fe6392fba193a (diff) | |
download | samba-a623359fb8a54083b81436d14b7ba022c11efb18.tar.gz |
python/drs: Ensure to pass in the local invocationID during the domain join
This ensures (and asserts) that we never write an all-zero GUID as an invocationID
to the database in replPropertyMetaData.
Andrew Bartlett
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'python/samba/drs_utils.py')
-rw-r--r-- | python/samba/drs_utils.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/python/samba/drs_utils.py b/python/samba/drs_utils.py index 6e2cfea9ab2..49837492b7d 100644 --- a/python/samba/drs_utils.py +++ b/python/samba/drs_utils.py @@ -147,12 +147,16 @@ def drs_DsBind(drs): class drs_Replicate(object): '''DRS replication calls''' - def __init__(self, binding_string, lp, creds, samdb): + def __init__(self, binding_string, lp, creds, samdb, invocation_id): self.drs = drsuapi.drsuapi(binding_string, lp, creds) (self.drs_handle, self.supported_extensions) = drs_DsBind(self.drs) self.net = Net(creds=creds, lp=lp) self.samdb = samdb - self.replication_state = self.net.replicate_init(self.samdb, lp, self.drs) + if not isinstance(invocation_id, misc.GUID): + raise RuntimeError("Must supply GUID for invocation_id") + if invocation_id == misc.GUID("00000000-0000-0000-0000-000000000000"): + raise RuntimeError("Must not set GUID 00000000-0000-0000-0000-000000000000 as invocation_id") + self.replication_state = self.net.replicate_init(self.samdb, lp, self.drs, invocation_id) def drs_get_rodc_partial_attribute_set(self): '''get a list of attributes for RODC replication''' |