The Samba-Bugzilla – Attachment 6797 Details for
Bug 8392
Allow setting DNS domainname != realm in provision
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Add Option --dnsdomain to provision to allow dnsdomain != realm
provision_dnsdomain_and_realm.diff (text/plain), 4.85 KB, created by
Arvid Requate
on 2011-08-22 09:50:22 UTC
(
hide
)
Description:
Add Option --dnsdomain to provision to allow dnsdomain != realm
Filename:
MIME Type:
Creator:
Arvid Requate
Created:
2011-08-22 09:50:22 UTC
Size:
4.85 KB
patch
obsolete
>diff --git a/source4/scripting/python/samba/provision/__init__.py b/source4/scripting/python/samba/provision/__init__.py >index c414bd0..c00303a 100644 >--- a/source4/scripting/python/samba/provision/__init__.py >+++ b/source4/scripting/python/samba/provision/__init__.py >@@ -561,7 +561,7 @@ def provision_paths_from_lp(lp, dnsdomain): > return paths > > >-def guess_names(lp=None, hostname=None, domain=None, dnsdomain=None, >+def guess_names(lp=None, hostname=None, domain=None, dnsdomain=None, realm=None, > serverrole=None, rootdn=None, domaindn=None, configdn=None, > schemadn=None, serverdn=None, sitename=None): > """Guess configuration settings to use.""" >@@ -585,7 +585,10 @@ def guess_names(lp=None, hostname=None, domain=None, dnsdomain=None, > raise InvalidNetbiosName(netbiosname) > > if dnsdomain is None: >- dnsdomain = lp.get("realm") >+ if realm: >+ dnsdomain = realm >+ else: >+ dnsdomain = lp.get("realm") > if dnsdomain is None or dnsdomain == "": > raise ProvisioningError("guess_names: 'realm' not specified in supplied %s!", lp.configfile) > >@@ -598,7 +601,8 @@ def guess_names(lp=None, hostname=None, domain=None, dnsdomain=None, > > serverrole = serverrole.lower() > >- realm = dnsdomain.upper() >+ if realm is None: >+ realm = dnsdomain.upper() > > if lp.get("realm") == "": > raise ProvisioningError("guess_names: 'realm =' was not specified in supplied %s. Please remove the smb.conf file and let provision generate it" % lp.configfile) >@@ -1517,7 +1519,7 @@ def interface_ips_v6(lp, linklocal=False): > > def provision(logger, session_info, credentials, smbconf=None, > targetdir=None, samdb_fill=FILL_FULL, realm=None, rootdn=None, >- domaindn=None, schemadn=None, configdn=None, serverdn=None, >+ realm=None, domaindn=None, schemadn=None, configdn=None, serverdn=None, > domain=None, hostname=None, hostip=None, hostip6=None, domainsid=None, > next_rid=1000, dc_rid=None, adminpass=None, ldapadminpass=None, krbtgtpass=None, > domainguid=None, policyguid=None, policyguid_dc=None, >@@ -1606,7 +1608,7 @@ def provision(logger, session_info, credentials, smbconf=None, > lp = samba.param.LoadParm() > lp.load(smbconf) > names = guess_names(lp=lp, hostname=hostname, domain=domain, >- dnsdomain=realm, serverrole=serverrole, domaindn=domaindn, >+ dnsdomain=dnsdomain, realm=realm, serverrole=serverrole, domaindn=domaindn, > configdn=configdn, schemadn=schemadn, serverdn=serverdn, > sitename=sitename) > paths = provision_paths_from_lp(lp, names.dnsdomain) >diff --git a/source4/setup/provision b/source4/setup/provision >index 7140b26..e521332 100755 >--- a/source4/setup/provision >+++ b/source4/setup/provision >@@ -54,6 +54,8 @@ parser.add_option_group(credopts) > parser.add_option("--interactive", help="Ask for names", action="store_true") > parser.add_option("--domain", type="string", metavar="DOMAIN", > help="set domain") >+parser.add_option("--dnsdomain", type="string", metavar="DNSDOMAIN", >+ help="set DNS domain") > parser.add_option("--domain-guid", type="string", metavar="GUID", > help="set domainguid (otherwise random)") > parser.add_option("--domain-sid", type="string", metavar="SID", >@@ -143,16 +145,16 @@ if opts.interactive: > default = socket.getfqdn().split(".", 1)[1].upper() > except IndexError: > default = None >- opts.realm = ask("Realm", default) >- if opts.realm in (None, ""): >- print >>sys.stderr, "No realm set!" >+ opts.dnsdomain = ask("DNS Domain", default) >+ opts.realm = ask("Realm", opts.dnsdomain.upper()) >+ if opts.realm in (None, "") and opts.dnsdomain in (None, ""): >+ print >>sys.stderr, "Realm or DNS Domain need to be set!" > sys.exit(1) > > try: > default = opts.realm.split(".")[0] > except IndexError: > default = None >- opts.domain = ask("Domain", default) > if opts.domain is None: > print >> sys.stderr, "No domain set!" > sys.exit(1) >@@ -165,9 +167,13 @@ if opts.interactive: > else: > break > else: >+ if opts.dnsdomain in (None, ""): >+ opts.dnsdomain = sambaopts._lp.get('dnsdomain') > if opts.realm in (None, ""): > opts.realm = sambaopts._lp.get('realm') >- if opts.realm is None or opts.domain is None: >+ if opts.dnsdomain is None or opts.realm is None or opts.domain is None: >+ if opts.dnsdomain is None: >+ print >> sys.stderr, "No DNS domain set!" > if opts.realm is None: > print >>sys.stderr, "No realm set!" > if opts.domain is None: >@@ -237,7 +243,7 @@ session = system_session() > try: > provision(logger, > session, creds, smbconf=smbconf, targetdir=opts.targetdir, >- samdb_fill=samdb_fill, realm=opts.realm, domain=opts.domain, >+ samdb_fill=samdb_fill, dnsdomain=opts.dnsdomain, realm=opts.realm, domain=opts.domain, > domainguid=opts.domain_guid, domainsid=opts.domain_sid, > hostname=opts.host_name, > hostip=opts.host_ip, hostip6=opts.host_ip6,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 8392
: 6797