summaryrefslogtreecommitdiff
path: root/source4/setup
diff options
context:
space:
mode:
authorNadezhda Ivanova <nadezhda.ivanova@postpath.com>2009-09-20 17:43:46 -0700
committerNadezhda Ivanova <nadezhda.ivanova@postpath.com>2009-09-20 17:43:46 -0700
commit025590e7a4758e86e7942642971b92fc6bab7a8e (patch)
treee48bb903f2aabf1707825c84cc3d9ff517eed125 /source4/setup
parent6283f2caaa42c7238bdc9c2e8bc1246207645019 (diff)
parent11bfbc516077d1cead94d0bc70ef24267b9014e7 (diff)
downloadsamba-025590e7a4758e86e7942642971b92fc6bab7a8e.tar.gz
samba-025590e7a4758e86e7942642971b92fc6bab7a8e.tar.bz2
samba-025590e7a4758e86e7942642971b92fc6bab7a8e.zip
Merge branch 'master' of git://git.samba.org/samba
Diffstat (limited to 'source4/setup')
-rwxr-xr-xsource4/setup/domainlevel35
-rwxr-xr-xsource4/setup/newuser2
-rwxr-xr-xsource4/setup/setexpiry2
3 files changed, 11 insertions, 28 deletions
diff --git a/source4/setup/domainlevel b/source4/setup/domainlevel
index 9386d199ac..b49150ff2d 100755
--- a/source4/setup/domainlevel
+++ b/source4/setup/domainlevel
@@ -41,7 +41,7 @@ credopts = options.CredentialsOptions(parser)
parser.add_option_group(credopts)
parser.add_option("--quiet", help="Be quiet", action="store_true")
parser.add_option("--forest",
- help="The forest function level (2000 | 2003 | 2008 | 2008_R2). We don't support mixed/interim (NT4 DC support) levels.", type=str)
+ help="The forest function level (2000 | 2003 | 2008 | 2008_R2). We don't support the 2003 with mixed domains (NT4 DC support) level.", type=str)
parser.add_option("--domain",
help="The domain function level (2000 | 2003 | 2008 | 2008_R2). We don't support mixed/interim (NT4 DC support) levels.", type=str)
opts, args = parser.parse_args()
@@ -69,48 +69,40 @@ res_forest = samdb.search("CN=Partitions,CN=Configuration," + domain_dn,
scope=ldb.SCOPE_BASE, attrs=["msDS-Behavior-Version"])
assert(len(res_forest) == 1)
-res_forest_mixed = samdb.search("CN=" + lp.get("workgroup") +
- ",CN=Partitions,CN=Configuration," + domain_dn,
- scope=ldb.SCOPE_BASE, attrs=["nTMixedDomain"])
-assert(len(res_forest_mixed) == 1)
-
res_domain = samdb.search(domain_dn, scope=ldb.SCOPE_BASE,
attrs=["msDS-Behavior-Version", "nTMixedDomain"])
assert(len(res_domain) == 1)
try:
level_forest = int(res_forest[0]["msDS-Behavior-Version"][0])
- level_forest_mixed = int(res_forest_mixed[0]["nTMixedDomain"][0])
level_domain = int(res_domain[0]["msDS-Behavior-Version"][0])
level_domain_mixed = int(res_domain[0]["nTMixedDomain"][0])
if level_forest < 0 or level_domain < 0:
print "ERROR: Domain and/or forest functional level(s) is/are invalid. Correct them or reprovision!"
sys.exit(1)
- if level_forest > level_domain or (level_forest_mixed < level_domain_mixed):
+ if level_forest > level_domain:
print "ERROR: Forest function level is higher than the domain level(s). That can't be. Correct this or reprovision!"
sys.exit(1)
except:
- print "ERROR: Could not retrieve the actual domain and forest level!"
+ print "ERROR: Could not retrieve the actual domain and/or forest level!"
if args[0] == "show":
print "So the levels can't be displayed!"
sys.exit(1)
if args[0] == "show":
message("Domain and forest function level for domain '" + domain_dn + "'")
- if (level_forest == DS_DOMAIN_FUNCTION_2000 and level_forest_mixed != 0) or level_forest == DS_DOMAIN_FUNCTION_2003_MIXED:
- message("\nATTENTION: You run SAMBA 4 on a mixed/interim (NT4 DC support) forest level. This isn't supported! Please raise!")
+ if level_forest == DS_DOMAIN_FUNCTION_2003_MIXED:
+ message("\nATTENTION: You run SAMBA 4 on the 2003 with mixed domains (NT4 DC support) forest level. This isn't supported! Please raise!")
if (level_domain == DS_DOMAIN_FUNCTION_2000 and level_domain_mixed != 0) or level_domain == DS_DOMAIN_FUNCTION_2003_MIXED:
message("\nATTENTION: You run SAMBA 4 on a mixed/interim (NT4 DC support) domain level. This isn't supported! Please raise!")
message("")
- if level_forest == DS_DOMAIN_FUNCTION_2000 and level_forest_mixed != 0:
- outstr = "2000 mixed (NT4 DC support)"
- elif level_forest == DS_DOMAIN_FUNCTION_2000 and level_forest_mixed == 0:
+ if level_forest == DS_DOMAIN_FUNCTION_2000:
outstr = "2000"
elif level_forest == DS_DOMAIN_FUNCTION_2003_MIXED:
- outstr = "2003 interim (NT4 DC support)"
+ outstr = "2003 with mixed domains/interim (NT4 DC support)"
elif level_forest == DS_DOMAIN_FUNCTION_2003:
outstr = "2003"
elif level_forest == DS_DOMAIN_FUNCTION_2008:
@@ -126,7 +118,7 @@ if args[0] == "show":
elif level_domain == DS_DOMAIN_FUNCTION_2000 and level_domain_mixed == 0:
outstr = "2000"
elif level_domain == DS_DOMAIN_FUNCTION_2003_MIXED:
- outstr = "2003 interim (NT4 DC support)"
+ outstr = "2003 with mixed domains/interim (NT4 DC support)"
elif level_domain == DS_DOMAIN_FUNCTION_2003:
outstr = "2003"
elif level_domain == DS_DOMAIN_FUNCTION_2008:
@@ -193,7 +185,7 @@ elif args[0] == "raise":
print "ERROR: Wrong argument '" + arg + "'!"
sys.exit(1)
- if new_level_forest <= level_forest and level_forest_mixed == 0:
+ if new_level_forest <= level_forest:
print "ERROR: Forest function level can't be smaller equal to the actual one!"
sys.exit(1)
@@ -201,15 +193,6 @@ elif args[0] == "raise":
print "ERROR: Forest function level can't be higher than the domain function level(s). Please raise it/them first!"
sys.exit(1)
- # Deactivate mixed/interim forest support
- if level_forest_mixed != 0:
- m = ldb.Message()
- m.dn = ldb.Dn(samdb, "CN=" + lp.get("workgroup")
- + ",CN=Partitions,CN=Configuration," + domain_dn)
- m["nTMixedDomain"] = ldb.MessageElement("0",
- ldb.FLAG_MOD_REPLACE, "nTMixedDomain")
- samdb.modify(m)
-
m = ldb.Message()
m.dn = ldb.Dn(samdb, "CN=Partitions,CN=Configuration,"
+ domain_dn)
diff --git a/source4/setup/newuser b/source4/setup/newuser
index 422677c301..10af55a458 100755
--- a/source4/setup/newuser
+++ b/source4/setup/newuser
@@ -60,4 +60,4 @@ creds = credopts.get_credentials(lp)
samdb = SamDB(url=lp.get("sam database"), session_info=system_session(),
credentials=creds, lp=lp)
-samdb.newuser(username, opts.unixname, password, force_password_change_at_next_login=opts.must_change_at_next_login)
+samdb.newuser(username, opts.unixname, password, force_password_change_at_next_login_req=opts.must_change_at_next_login)
diff --git a/source4/setup/setexpiry b/source4/setup/setexpiry
index 6c6305ceaf..1572555b8c 100755
--- a/source4/setup/setexpiry
+++ b/source4/setup/setexpiry
@@ -61,4 +61,4 @@ creds = credopts.get_credentials(lp)
samdb = SamDB(url=lp.get("sam database"), session_info=system_session(),
credentials=creds, lp=lp)
-samdb.setexpiry(filter, days*24*3600, noexpiry=opts.noexpiry)
+samdb.setexpiry(filter, days*24*3600, no_expiry_req=opts.noexpiry)