Fix provision script to work without smb.conf location specified.
authorAndrew Bartlett <abartlet@samba.org>
Tue, 11 Mar 2008 03:41:10 +0000 (14:41 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 11 Mar 2008 03:41:10 +0000 (14:41 +1100)
Andrew Bartlett
(This used to be commit b4da374a998caac18c288a0a6e3fcd2c50cbffa7)

source4/scripting/python/samba/provision.py
source4/setup/provision

index ebca1f8e40a0fbdff9458ae9da4e2d6af6ae90e1..24870c2fbd0abcbcc5657144e412cb5e6852daf0 100644 (file)
@@ -51,7 +51,6 @@ class InvalidNetbiosName(Exception):
 
 class ProvisionPaths:
     def __init__(self):
-        self.smbconf = None
         self.shareconf = None
         self.hklm = None
         self.hkcu = None
@@ -217,7 +216,6 @@ def provision_paths_from_lp(lp, dnsdomain):
     paths.dns = os.path.join(paths.private_dir, dnsdomain + ".zone")
     paths.winsdb = os.path.join(paths.private_dir, "wins.ldb")
     paths.s4_ldapi_path = os.path.join(paths.private_dir, "ldapi")
-    paths.smbconf = os.path.join(paths.private_dir, "smb.conf")
     paths.phpldapadminconfig = os.path.join(paths.private_dir, 
                                             "phpldapadmin-config.php")
     paths.hklm = "hklm.ldb"
@@ -759,6 +757,9 @@ def provision(setup_dir, message, session_info,
 
     if domainsid is None:
         domainsid = security.random_sid()
+    else:
+        domainsid = security.Sid(domainsid)
+
     if policyguid is None:
         policyguid = uuid.random()
     if adminpass is None:
index 629bfa10e0f01aaaefce6cdee81c07c482816de7..b0363d8a8f2a24a15284e082d465e5eba6e5dd3b 100755 (executable)
@@ -27,6 +27,7 @@ import optparse
 import os, sys
 
 import samba
+import param
 
 from auth import system_session
 import samba.getopt as options
@@ -110,7 +111,7 @@ if opts.realm is None or opts.domain is None:
        parser.print_usage()
        sys.exit(1)
 
-smbconf = sambaopts.get_loadparm_path()
+smbconf = sambaopts.get_loadparm().configfile()
 
 if opts.aci is not None:
        print "set ACI: %s" % opts.aci