diff options
Diffstat (limited to 'source4')
-rwxr-xr-x | source4/scripting/bin/mymachinepw | 12 | ||||
-rw-r--r-- | source4/scripting/python/samba/provision.py | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/source4/scripting/bin/mymachinepw b/source4/scripting/bin/mymachinepw index 49a4245a3a..3a843b5947 100755 --- a/source4/scripting/bin/mymachinepw +++ b/source4/scripting/bin/mymachinepw @@ -40,8 +40,7 @@ if not loaded: path=conf.get("private dir") + "/secrets.ldb" netbios=conf.get("netbios name") -secrets = ldb.Ldb() -secrets.connect(path) +secrets = ldb.Ldb(path) search = "(&(objectclass=primaryDomain)(samaccountname=" + \ netbios + "$))" @@ -49,13 +48,12 @@ search = "(&(objectclass=primaryDomain)(samaccountname=" + \ msg = secrets.search(expression=search, attrs=['secret']) if not msg: - error = "Error:\n" - error += "Password for host[" + netbios + "] not found in path[" + path + "].\n" - error += "You may want to pass the smb.conf location via the -s option." - print error + print "Error:" + print "Password for host[%s] not found in path[%s]." % (netbios, path) + print "You may want to pass the smb.conf location via the -s option." exit(1) -password=msg[0]['secret'][0]; +password=msg[0]['secret'][0] print(password) exit(0) diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py index 441d662b23..6b1fd33b9f 100644 --- a/source4/scripting/python/samba/provision.py +++ b/source4/scripting/python/samba/provision.py @@ -1435,6 +1435,7 @@ def load_schema(setup_path, samdb, schemadn, netbiosname, configdn, sitename): schema_data = open(setup_path("schema.ldif"), 'r').read() schema_data += open(setup_path("schema_samba4.ldif"), 'r').read() schema_data = substitute_var(schema_data, {"SCHEMADN": schemadn}) + check_all_substituted(schema_data) prefixmap = open(setup_path("prefixMap.txt"), 'r').read() prefixmap = b64encode(prefixmap) @@ -1446,5 +1447,6 @@ def load_schema(setup_path, samdb, schemadn, netbiosname, configdn, sitename): "DEFAULTSITE":sitename, "PREFIXMAP_B64":prefixmap }) + check_all_substituted(head_data) samdb.attach_schema_from_ldif(head_data, schema_data) |