summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-07-11 10:53:52 +1000
committerAndrew Tridgell <tridge@samba.org>2011-07-11 14:32:44 +1000
commit059941b6e76589d76773b66643b2ec6826a17800 (patch)
treefde55c96fc260a9c230cdec76598f0ca08e92d8b /source4
parent86b7b5cd9621946a3ea20905c0559d662c84770b (diff)
downloadsamba-059941b6e76589d76773b66643b2ec6826a17800.tar.gz
samba-059941b6e76589d76773b66643b2ec6826a17800.tar.bz2
samba-059941b6e76589d76773b66643b2ec6826a17800.zip
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>
Diffstat (limited to 'source4')
-rw-r--r--source4/scripting/python/samba/netcmd/dbcheck.py11
1 files 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,