diff options
author | Kamen Mazdrashki <kamenim@samba.org> | 2010-12-22 01:09:59 +0200 |
---|---|---|
committer | Kamen Mazdrashki <kamenim@samba.org> | 2010-12-22 01:28:49 +0100 |
commit | 2ce6e648ed0354a0df5608a8b43ce0be967cc08f (patch) | |
tree | b955beb42c8495ce2fda08ba9b17a014cbd09d02 /source4 | |
parent | e43de85b97dfa584ba9cfb7b18ed302fddb767ae (diff) | |
download | samba-2ce6e648ed0354a0df5608a8b43ce0be967cc08f.tar.gz samba-2ce6e648ed0354a0df5608a8b43ce0be967cc08f.tar.bz2 samba-2ce6e648ed0354a0df5608a8b43ce0be967cc08f.zip |
s4-devel/pfm_verify: Move schemaInfo getter into separate function
so it can be used against Windows DC without fetching prefixMap
Fetching prefixMap doesn't work against WinDCs for some reason at the moment
Autobuild-User: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-Date: Wed Dec 22 01:28:49 CET 2010 on sn-devel-104
Diffstat (limited to 'source4')
-rwxr-xr-x | source4/scripting/devel/pfm_verify.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/source4/scripting/devel/pfm_verify.py b/source4/scripting/devel/pfm_verify.py index 300fd05bdd..2b54aadeb4 100755 --- a/source4/scripting/devel/pfm_verify.py +++ b/source4/scripting/devel/pfm_verify.py @@ -42,14 +42,22 @@ def _samdb_fetch_pfm(samdb): assert len(res) == 1 pfm = ndr_unpack(drsblobs.prefixMapBlob, str(res[0]['prefixMap'])) - pfm_schi = None + + pfm_schi = _samdb_fetch_schi(samdb) + + return (pfm.ctr, pfm_schi) + +def _samdb_fetch_schi(samdb): + """Fetch schemaInfo stored in SamDB using LDB connection""" + res = samdb.search(base=samdb.get_schema_basedn(), expression="", scope=SCOPE_BASE, attrs=["*"]) + assert len(res) == 1 if 'schemaInfo' in res[0]: - pfm_schi = pfm_schi = ndr_unpack(drsblobs.schemaInfoBlob, - str(res[0]['schemaInfo'])) + pfm_schi = ndr_unpack(drsblobs.schemaInfoBlob, + str(res[0]['schemaInfo'])) else: pfm_schi = drsblobs.schemaInfoBlob() pfm_schi.marker = 0xFF; - return (pfm.ctr, pfm_schi) + return pfm_schi def _drs_fetch_pfm(server, samdb, creds, lp): """Fetch prefixMap using DRS interface""" |