1
0
mirror of https://github.com/samba-team/samba.git synced 2025-06-10 15:17:05 +03:00

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 <amitay@gmail.com>
This commit is contained in:
Andrew Tridgell 2011-07-11 10:53:52 +10:00
parent 86b7b5cd96
commit 059941b6e7

View File

@ -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,