dbcheck: use specified DB schema for non-LDAP URLs
authorAndrew Tridgell <tridge@samba.org>
Mon, 11 Jul 2011 00:53:52 +0000 (10:53 +1000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 11 Jul 2011 04:32:44 +0000 (14:32 +1000)
when connecting to a local database with -H we can use that databases
schema

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>

source4/scripting/python/samba/netcmd/dbcheck.py

index c97942bc90f5aae7ba9fe43ed6304ae8dd1b5cd8..fce45306caa8478d01b2b2fd3887e102cd92e448 100644 (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,