From 059941b6e76589d76773b66643b2ec6826a17800 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 11 Jul 2011 10:53:52 +1000 Subject: dbcheck: use specified DB schema for non-LDAP URLs when connecting to a local database with -H we can use that databases schema Pair-Programmed-With: Amitay Isaacs --- source4/scripting/python/samba/netcmd/dbcheck.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source4/scripting/python/samba/netcmd/dbcheck.py b/source4/scripting/python/samba/netcmd/dbcheck.py index c97942bc90..fce45306ca 100644 --- a/source4/scripting/python/samba/netcmd/dbcheck.py +++ b/source4/scripting/python/samba/netcmd/dbcheck.py @@ -63,11 +63,18 @@ class cmd_dbcheck(Command): scope="SUB", credopts=None, sambaopts=None, versionopts=None, attrs=None): lp = sambaopts.get_loadparm() - creds = credopts.get_credentials(lp, fallback_machine=True) + + over_ldap = H is not None and H.startswith('ldap') + + if over_ldap: + creds = credopts.get_credentials(lp, fallback_machine=True) + else: + creds = None samdb = SamDB(session_info=system_session(), url=H, credentials=creds, lp=lp) - if H is None: + + if H is None or not over_ldap: samdb_schema = samdb else: samdb_schema = SamDB(session_info=system_session(), url=None, -- cgit