summaryrefslogtreecommitdiff
path: root/source4/setup
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-10-17 10:36:33 -0700
committerJeremy Allison <jra@samba.org>2009-10-17 10:36:33 -0700
commit7c51fa6d699a653cafa90df8e44911b576118ebd (patch)
tree543bf9ca698e03eff81104898b33e77f1abed319 /source4/setup
parentcc3a6770c77ec8fe1cd63bf4c682853c56201f0c (diff)
parent3e3214fd91471bca5b6c4d3782e922d252d588fb (diff)
downloadsamba-7c51fa6d699a653cafa90df8e44911b576118ebd.tar.gz
samba-7c51fa6d699a653cafa90df8e44911b576118ebd.tar.bz2
samba-7c51fa6d699a653cafa90df8e44911b576118ebd.zip
Merge branch 'master' of ssh://jra@git.samba.org/data/git/samba
Diffstat (limited to 'source4/setup')
-rwxr-xr-xsource4/setup/domainlevel92
-rw-r--r--source4/setup/fedorads-index.ldif7
-rw-r--r--source4/setup/fedorads-linked-attributes.ldif7
-rw-r--r--source4/setup/fedorads-pam.ldif2
-rw-r--r--source4/setup/fedorads-refint-add.ldif6
-rw-r--r--source4/setup/fedorads-refint-delete.ldif20
-rw-r--r--source4/setup/fedorads.inf4
-rwxr-xr-xsource4/setup/provision25
-rw-r--r--source4/setup/provision.ldif5
-rw-r--r--source4/setup/provision_basedn.ldif5
-rw-r--r--source4/setup/provision_basedn_modify.ldif1
-rw-r--r--source4/setup/provision_configuration.ldif10
-rw-r--r--source4/setup/provision_configuration_basedn.ldif1
-rw-r--r--source4/setup/provision_privilege.ldif78
-rw-r--r--source4/setup/provision_schema_basedn.ldif1
-rw-r--r--source4/setup/provision_schema_basedn_modify.ldif2
-rw-r--r--source4/setup/provision_self_join.ldif1
-rw-r--r--source4/setup/provision_users.ldif79
-rwxr-xr-xsource4/setup/pwsettings23
-rw-r--r--source4/setup/schema_samba4.ldif93
20 files changed, 293 insertions, 169 deletions
diff --git a/source4/setup/domainlevel b/source4/setup/domainlevel
index ceab735c8f..c37d811dd8 100755
--- a/source4/setup/domainlevel
+++ b/source4/setup/domainlevel
@@ -18,6 +18,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
+# Notice: At the moment we have some more checks to do here on the special
+# attributes (consider attribute "msDS-Behavior-Version). This is due to the
+# fact that we on s4 LDB don't implement their change policy (only certain
+# values, only increments possible...) yet.
+
import sys
# Find right directory when running from source tree
@@ -32,6 +37,8 @@ from samba.samdb import SamDB
from samba import DS_DOMAIN_FUNCTION_2000, DS_DOMAIN_FUNCTION_2003
from samba import DS_DOMAIN_FUNCTION_2003_MIXED, DS_DOMAIN_FUNCTION_2008
from samba import DS_DOMAIN_FUNCTION_2008_R2
+from samba import DS_DC_FUNCTION_2000, DS_DC_FUNCTION_2003, DS_DC_FUNCTION_2008
+from samba import DS_DC_FUNCTION_2008_R2
parser = optparse.OptionParser("domainlevel (show | raise <options>)")
sambaopts = options.SambaOptions(parser)
@@ -41,10 +48,12 @@ credopts = options.CredentialsOptions(parser)
parser.add_option_group(credopts)
parser.add_option("-H", help="LDB URL for database or target server", type=str)
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 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)
+parser.add_option("--forest", type="choice",
+ choices=["2003", "2008", "2008_R2"],
+ help="The forest function level (2003 | 2008 | 2008_R2)")
+parser.add_option("--domain", type="choice",
+ choices=["2003", "2008", "2008_R2"],
+ help="The domain function level (2003 | 2008 | 2008_R2)")
opts, args = parser.parse_args()
#
@@ -78,29 +87,48 @@ res_domain = samdb.search(domain_dn, scope=ldb.SCOPE_BASE,
attrs=["msDS-Behavior-Version", "nTMixedDomain"])
assert(len(res_domain) == 1)
+res_dc_s = samdb.search("CN=Sites,CN=Configuration," + domain_dn,
+ scope=ldb.SCOPE_SUBTREE, expression="(objectClass=nTDSDSA)",
+ attrs=["msDS-Behavior-Version"])
+assert(len(res_dc_s) >= 1)
+
try:
level_forest = int(res_forest[0]["msDS-Behavior-Version"][0])
level_domain = int(res_domain[0]["msDS-Behavior-Version"][0])
level_domain_mixed = int(res_domain[0]["nTMixedDomain"][0])
+ min_level_dc = int(res_dc_s[0]["msDS-Behavior-Version"][0]) # Init value
+ for msg in res_dc_s:
+ if int(msg["msDS-Behavior-Version"][0]) < min_level_dc:
+ min_level_dc = int(msg["msDS-Behavior-Version"][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!"
+ print >>sys.stderr, "ERROR: Domain and/or forest function level(s) is/are invalid. Correct them or reprovision!"
+ sys.exit(1)
+ if min_level_dc < 0:
+ print >>sys.stderr, "ERROR: Lowest function level of a DC is invalid. Correct this or reprovision!"
sys.exit(1)
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!"
+ print >>sys.stderr, "ERROR: Forest function level is higher than the domain level(s). Correct this or reprovision!"
+ sys.exit(1)
+ if level_domain > min_level_dc:
+ print >>sys.stderr, "ERROR: Domain function level is higher than the lowest function level of a DC. Correct this or reprovision!"
sys.exit(1)
-except:
- print "ERROR: Could not retrieve the actual domain and/or forest level!"
+
+except KeyError:
+ print >>sys.stderr, "ERROR: Could not retrieve the actual domain, forest level and/or lowest DC function level!"
if args[0] == "show":
- print "So the levels can't be displayed!"
+ print >>sys.stderr, "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_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!")
+ if level_forest < DS_DOMAIN_FUNCTION_2003:
+ message("\nATTENTION: You run SAMBA 4 on a forest function level lower than Windows 2003 (Native). This isn't supported! Please raise!")
+ if level_domain < DS_DOMAIN_FUNCTION_2003:
+ message("\nATTENTION: You run SAMBA 4 on a domain function level lower than Windows 2003 (Native). This isn't supported! Please raise!")
+ if min_level_dc < DS_DC_FUNCTION_2003:
+ message("\nATTENTION: You run SAMBA 4 on a lowest function level of a DC lower than Windows 2003. This isn't supported! Please step-up or upgrade the concerning DC(s)!")
message("")
@@ -134,26 +162,37 @@ if args[0] == "show":
outstr = "higher than 2008 R2"
message("Domain function level: (Windows) " + outstr)
+ if min_level_dc == DS_DC_FUNCTION_2000:
+ outstr = "2000"
+ elif min_level_dc == DS_DC_FUNCTION_2003:
+ outstr = "2003"
+ elif min_level_dc == DS_DC_FUNCTION_2008:
+ outstr = "2008"
+ elif min_level_dc == DS_DC_FUNCTION_2008_R2:
+ outstr = "2008 R2"
+ else:
+ outstr = "higher than 2008 R2"
+ message("Lowest function level of a DC: (Windows) " + outstr)
+
elif args[0] == "raise":
msgs = []
if opts.domain is not None:
arg = opts.domain
- if arg == "2000":
- new_level_domain = DS_DOMAIN_FUNCTION_2000
- elif arg == "2003":
+ if arg == "2003":
new_level_domain = DS_DOMAIN_FUNCTION_2003
elif arg == "2008":
new_level_domain = DS_DOMAIN_FUNCTION_2008
elif arg == "2008_R2":
new_level_domain = DS_DOMAIN_FUNCTION_2008_R2
- else:
- print "ERROR: Wrong argument '" + arg + "'!"
- sys.exit(1)
if new_level_domain <= level_domain and level_domain_mixed == 0:
- print "ERROR: Domain function level can't be smaller equal to the actual one!"
+ print >>sys.stderr, "ERROR: Domain function level can't be smaller equal to the actual one!"
+ sys.exit(1)
+
+ if new_level_domain > min_level_dc:
+ print >>sys.stderr, "ERROR: Domain function level can't be higher than the lowest function level of a DC!"
sys.exit(1)
# Deactivate mixed/interim domain support
@@ -178,24 +217,19 @@ elif args[0] == "raise":
if opts.forest is not None:
arg = opts.forest
- if arg == "2000":
- new_level_forest = DS_DOMAIN_FUNCTION_2000
- elif arg == "2003":
+ if arg == "2003":
new_level_forest = DS_DOMAIN_FUNCTION_2003
elif arg == "2008":
new_level_forest = DS_DOMAIN_FUNCTION_2008
elif arg == "2008_R2":
new_level_forest = DS_DOMAIN_FUNCTION_2008_R2
- else:
- print "ERROR: Wrong argument '" + arg + "'!"
- sys.exit(1)
if new_level_forest <= level_forest:
- print "ERROR: Forest function level can't be smaller equal to the actual one!"
+ print >>sys.stderr, "ERROR: Forest function level can't be smaller equal to the actual one!"
sys.exit(1)
if new_level_forest > level_domain:
- print "ERROR: Forest function level can't be higher than the domain function level(s). Please raise it/them first!"
+ print >>sys.stderr, "ERROR: Forest function level can't be higher than the domain function level(s). Please raise it/them first!"
sys.exit(1)
m = ldb.Message()
@@ -212,5 +246,5 @@ elif args[0] == "raise":
message("\n".join(msgs))
else:
- print "ERROR: Wrong argument '" + args[0] + "'!"
+ print >>sys.stderr, "ERROR: Wrong argument '" + args[0] + "'!"
sys.exit(1)
diff --git a/source4/setup/fedorads-index.ldif b/source4/setup/fedorads-index.ldif
new file mode 100644
index 0000000000..4b4eb23499
--- /dev/null
+++ b/source4/setup/fedorads-index.ldif
@@ -0,0 +1,7 @@
+dn: cn=${ATTR},cn=default indexes,cn=config,cn=ldbm database,cn=plugins,cn=config
+objectClass: top
+objectClass: nsIndex
+cn: ${ATTR}
+nsSystemIndex: false
+nsIndexType: eq
+
diff --git a/source4/setup/fedorads-linked-attributes.ldif b/source4/setup/fedorads-linked-attributes.ldif
new file mode 100644
index 0000000000..05abcf9500
--- /dev/null
+++ b/source4/setup/fedorads-linked-attributes.ldif
@@ -0,0 +1,7 @@
+# Link ${MEMBER_ATTR} to ${MEMBEROF_ATTR}
+dn: cn=${MEMBER_ATTR} to ${MEMBEROF_ATTR},cn=Linked Attributes,cn=plugins,cn=config
+objectClass: extensibleObject
+cn: ${MEMBER_ATTR} to ${MEMBEROF_ATTR}
+linkType: ${MEMBER_ATTR}
+managedType: ${MEMBEROF_ATTR}
+
diff --git a/source4/setup/fedorads-pam.ldif b/source4/setup/fedorads-pam.ldif
new file mode 100644
index 0000000000..5ffd5cf016
--- /dev/null
+++ b/source4/setup/fedorads-pam.ldif
@@ -0,0 +1,2 @@
+dn: cn=PAM Pass Through Auth,cn=plugins,cn=config
+changetype: delete
diff --git a/source4/setup/fedorads-refint-add.ldif b/source4/setup/fedorads-refint-add.ldif
new file mode 100644
index 0000000000..2deb07dcbd
--- /dev/null
+++ b/source4/setup/fedorads-refint-add.ldif
@@ -0,0 +1,6 @@
+dn: cn=referential integrity postoperation,cn=plugins,cn=config
+changetype: modify
+add: nsslapd-pluginArg${ARG_NUMBER}
+nsslapd-pluginArg${ARG_NUMBER}: ${LINK_ATTR}
+-
+
diff --git a/source4/setup/fedorads-refint-delete.ldif b/source4/setup/fedorads-refint-delete.ldif
new file mode 100644
index 0000000000..cd20b839b3
--- /dev/null
+++ b/source4/setup/fedorads-refint-delete.ldif
@@ -0,0 +1,20 @@
+dn: cn=referential integrity postoperation,cn=plugins,cn=config
+changetype: modify
+delete: nsslapd-pluginArg3
+-
+
+dn: cn=referential integrity postoperation,cn=plugins,cn=config
+changetype: modify
+delete: nsslapd-pluginArg4
+-
+
+dn: cn=referential integrity postoperation,cn=plugins,cn=config
+changetype: modify
+delete: nsslapd-pluginArg5
+-
+
+dn: cn=referential integrity postoperation,cn=plugins,cn=config
+changetype: modify
+delete: nsslapd-pluginArg6
+-
+
diff --git a/source4/setup/fedorads.inf b/source4/setup/fedorads.inf
index 90ebe6a9a5..e0676c41df 100644
--- a/source4/setup/fedorads.inf
+++ b/source4/setup/fedorads.inf
@@ -28,3 +28,7 @@ install_full_schema= 0
SchemaFile=${LDAPDIR}/99_ad.ldif
ConfigFile = ${LDAPDIR}/fedorads-partitions.ldif
ConfigFile = ${LDAPDIR}/fedorads-sasl.ldif
+ConfigFile = ${LDAPDIR}/fedorads-pam.ldif
+ConfigFile = ${LDAPDIR}/fedorads-refint.ldif
+ConfigFile = ${LDAPDIR}/fedorads-linked-attributes.ldif
+ConfigFile = ${LDAPDIR}/fedorads-index.ldif
diff --git a/source4/setup/provision b/source4/setup/provision
index 8bf08b9e39..1cfcfc7137 100755
--- a/source4/setup/provision
+++ b/source4/setup/provision
@@ -93,7 +93,10 @@ parser.add_option("--ldap-backend-type", type="choice", metavar="LDAP-BACKEND-TY
parser.add_option("--ldap-backend-nosync", help="Configure LDAP backend not to call fsync() (for performance in test environments)", action="store_true")
parser.add_option("--server-role", type="choice", metavar="ROLE",
choices=["domain controller", "dc", "member server", "member", "standalone"],
- help="Set server role to provision for (default standalone)")
+ help="The server role (domain controller | dc | member server | member | standalone). Default is standalone.")
+parser.add_option("--function-level", type="choice", metavar="FOR-FUN-LEVEL",
+ choices=["2003", "2008", "2008_R2"],
+ help="The domain and forest function level (2003 | 2008 | 2008_R2). Default is (Windows) 2003 (Native).")
parser.add_option("--partitions-only",
help="Configure Samba's partitions, but do not modify them (ie, join a BDC)", action="store_true")
parser.add_option("--targetdir", type="string", metavar="DIR",
@@ -164,6 +167,15 @@ elif opts.server_role == "member":
else:
server_role = opts.server_role
+if opts.function_level is None:
+ dom_for_fun_level = None
+elif opts.function_level == "2003":
+ dom_for_fun_level = DS_DOMAIN_FUNCTION_2003
+elif opts.function_level == "2008":
+ dom_for_fun_level = DS_DOMAIN_FUNCTION_2008
+elif opts.function_level == "2008_R2":
+ dom_for_fun_level = DS_DOMAIN_FUNCTION_2008_R2
+
creds = credopts.get_credentials(lp)
creds.set_kerberos_state(DONT_USE_KERBEROS)
@@ -190,12 +202,9 @@ provision(setup_dir, message,
krbtgtpass=opts.krbtgtpass, machinepass=opts.machinepass,
dnspass=opts.dnspass, root=opts.root, nobody=opts.nobody,
wheel=opts.wheel, users=opts.users,
- serverrole=server_role,
+ serverrole=server_role, dom_for_fun_level=dom_for_fun_level,
ldap_backend_extra_port=opts.ldap_backend_extra_port,
ldap_backend_type=opts.ldap_backend_type,
- ldapadminpass=opts.ldapadminpass,
- ol_mmr_urls=opts.ol_mmr_urls,
- slapd_path=opts.slapd_path,
- setup_ds_path=opts.setup_ds_path,
- nosync=opts.nosync,
- ldap_dryrun_mode=opts.ldap_dryrun_mode)
+ ldapadminpass=opts.ldapadminpass, ol_mmr_urls=opts.ol_mmr_urls,
+ slapd_path=opts.slapd_path, setup_ds_path=opts.setup_ds_path,
+ nosync=opts.nosync,ldap_dryrun_mode=opts.ldap_dryrun_mode)
diff --git a/source4/setup/provision.ldif b/source4/setup/provision.ldif
index 0e30efc617..395d404268 100644
--- a/source4/setup/provision.ldif
+++ b/source4/setup/provision.ldif
@@ -137,6 +137,11 @@ dn: CN=DomainUpdates,CN=System,${DOMAINDN}
objectClass: top
objectClass: container
+dn: CN=ActiveDirectoryUpdate,CN=DomainUpdates,CN=System,${DOMAINDN}
+objectClass: top
+objectClass: container
+revision: 5
+
dn: CN=Operations,CN=DomainUpdates,CN=System,${DOMAINDN}
objectClass: top
objectClass: container
diff --git a/source4/setup/provision_basedn.ldif b/source4/setup/provision_basedn.ldif
index df34e4bbf0..eea8d4f148 100644
--- a/source4/setup/provision_basedn.ldif
+++ b/source4/setup/provision_basedn.ldif
@@ -3,5 +3,6 @@
################################
dn: ${DOMAINDN}
objectClass: top
-objectClass: ${DOMAIN_OC}
-
+objectClass: domaindns
+instanceType: 5
+${DOMAINGUID}
diff --git a/source4/setup/provision_basedn_modify.ldif b/source4/setup/provision_basedn_modify.ldif
index 39fd08e0d8..7fc5c6bf86 100644
--- a/source4/setup/provision_basedn_modify.ldif
+++ b/source4/setup/provision_basedn_modify.ldif
@@ -110,4 +110,3 @@ wellKnownObjects: B:32:a361b2ffffd211d1aa4b00c04fd7d83a:OU=Domain Controllers,${
wellKnownObjects: B:32:aa312825768811d1aded00c04fd8d5cd:CN=Computers,${DOMAINDN}
wellKnownObjects: B:32:a9d1ca15768811d1aded00c04fd8d5cd:CN=Users,${DOMAINDN}
-
-${DOMAINGUID_MOD}
diff --git a/source4/setup/provision_configuration.ldif b/source4/setup/provision_configuration.ldif
index 48b4dad98c..0716345c4a 100644
--- a/source4/setup/provision_configuration.ldif
+++ b/source4/setup/provision_configuration.ldif
@@ -647,6 +647,16 @@ dn: CN=ForestUpdates,${CONFIGDN}
objectClass: top
objectClass: container
+dn: CN=ActiveDirectoryRodcUpdate,CN=ForestUpdates,${CONFIGDN}
+objectClass: top
+objectClass: container
+revision: 5
+
+dn: CN=ActiveDirectoryUpdate,CN=ForestUpdates,${CONFIGDN}
+objectClass: top
+objectClass: container
+revision: 5
+
dn: CN=Operations,CN=ForestUpdates,${CONFIGDN}
objectClass: top
objectClass: container
diff --git a/source4/setup/provision_configuration_basedn.ldif b/source4/setup/provision_configuration_basedn.ldif
index b385359a61..14a2c33258 100644
--- a/source4/setup/provision_configuration_basedn.ldif
+++ b/source4/setup/provision_configuration_basedn.ldif
@@ -6,3 +6,4 @@ objectClass: top
objectClass: configuration
cn: Configuration
nTSecurityDescriptor:: ${DESCRIPTOR}
+instanceType: 13
diff --git a/source4/setup/provision_privilege.ldif b/source4/setup/provision_privilege.ldif
new file mode 100644
index 0000000000..0916c59f30
--- /dev/null
+++ b/source4/setup/provision_privilege.ldif
@@ -0,0 +1,78 @@
+# default privileges - more can be added via LSA or ldbedit
+dn: @ATTRIBUTES
+comment: CASE_INSENSITIVE
+privilege: CASE_INSENSITIVE
+
+dn: @INDEXLIST
+@IDXATTR: objectSid
+@IDXATTR: privilege
+
+dn: sid=S-1-5-32-544
+objectClass: privilege
+comment: Administrators
+objectSid: S-1-5-32-544
+privilege: SeSecurityPrivilege
+privilege: SeBackupPrivilege
+privilege: SeRestorePrivilege
+privilege: SeSystemtimePrivilege
+privilege: SeShutdownPrivilege
+privilege: SeRemoteShutdownPrivilege
+privilege: SeTakeOwnershipPrivilege
+privilege: SeDebugPrivilege
+privilege: SeSystemEnvironmentPrivilege
+privilege: SeSystemProfilePrivilege
+privilege: SeProfileSingleProcessPrivilege
+privilege: SeIncreaseBasePriorityPrivilege
+privilege: SeLoadDriverPrivilege
+privilege: SeCreatePagefilePrivilege
+privilege: SeIncreaseQuotaPrivilege
+privilege: SeChangeNotifyPrivilege
+privilege: SeUndockPrivilege
+privilege: SeManageVolumePrivilege
+privilege: SeImpersonatePrivilege
+privilege: SeCreateGlobalPrivilege
+privilege: SeEnableDelegationPrivilege
+privilege: SeInteractiveLogonRight
+privilege: SeNetworkLogonRight
+privilege: SeRemoteInteractiveLogonRight
+
+dn: sid=S-1-5-32-550
+objectClass: privilege
+comment: Print Operators
+objectSid: S-1-5-32-550
+privilege: SeLoadDriverPrivilege
+privilege: SeShutdownPrivilege
+privilege: SeInteractiveLogonRight
+
+dn: sid=S-1-5-32-551
+objectClass: privilege
+comment: Backup Operators
+objectSid: S-1-5-32-551
+privilege: SeBackupPrivilege
+privilege: SeRestorePrivilege
+privilege: SeShutdownPrivilege
+privilege: SeInteractiveLogonRight
+
+dn: sid=S-1-5-32-549
+objectClass: privilege
+comment: Server Operators
+objectSid: S-1-5-32-549
+privilege: SeBackupPrivilege
+privilege: SeSystemtimePrivilege
+privilege: SeRemoteShutdownPrivilege
+privilege: SeRestorePrivilege
+privilege: SeShutdownPrivilege
+privilege: SeInteractiveLogonRight
+
+dn: sid=S-1-5-32-548
+objectClass: privilege
+comment: Account Operators
+objectSid: S-1-5-32-548
+privilege: SeInteractiveLogonRight
+
+dn: sid=S-1-5-32-554
+objectClass: privilege
+comment: Pre-Windows 2000 Compatible Access
+objectSid: S-1-5-32-554
+privilege: SeRemoteInteractiveLogonRight
+privilege: SeChangeNotifyPrivilege
diff --git a/source4/setup/provision_schema_basedn.ldif b/source4/setup/provision_schema_basedn.ldif
index 5301a11965..6fe0b0ea93 100644
--- a/source4/setup/provision_schema_basedn.ldif
+++ b/source4/setup/provision_schema_basedn.ldif
@@ -6,3 +6,4 @@ objectClass: top
objectClass: dMD
cn: Schema
nTSecurityDescriptor:: ${DESCRIPTOR}
+instanceType: 13
diff --git a/source4/setup/provision_schema_basedn_modify.ldif b/source4/setup/provision_schema_basedn_modify.ldif
index 07a7dad320..93266db624 100644
--- a/source4/setup/provision_schema_basedn_modify.ldif
+++ b/source4/setup/provision_schema_basedn_modify.ldif
@@ -6,5 +6,5 @@ changetype: modify
-
# "masteredBy", "msDs-masteredBy" filled in later
replace: objectVersion
-objectVersion: 30
+objectVersion: 47
diff --git a/source4/setup/provision_self_join.ldif b/source4/setup/provision_self_join.ldif
index 639bc96040..0d28b51a43 100644
--- a/source4/setup/provision_self_join.ldif
+++ b/source4/setup/provision_self_join.ldif
@@ -67,6 +67,7 @@ msDS-hasMasterNCs: ${SCHEMADN}
msDS-hasMasterNCs: ${DOMAINDN}
options: 1
systemFlags: 33554432
+${NTDSGUID}
# Provides an account for DNS keytab export
dn: CN=dns,CN=Users,${DOMAINDN}
diff --git a/source4/setup/provision_users.ldif b/source4/setup/provision_users.ldif
index bc5616ba5b..161d305229 100644
--- a/source4/setup/provision_users.ldif
+++ b/source4/setup/provision_users.ldif
@@ -1,5 +1,6 @@
-# Add default primary groups (domain users, domain guests) - needed for
-# the users to find valid primary groups (samldb module)
+# Add default primary groups (domain users, domain guests, domain computers &
+# domain controllers) - needed for the users to find valid primary groups
+# (samldb module)
dn: CN=Domain Users,CN=Users,${DOMAINDN}
objectClass: top
@@ -17,6 +18,23 @@ objectSid: ${DOMAINSID}-514
sAMAccountName: Domain Guests
isCriticalSystemObject: TRUE
+dn: CN=Domain Computers,CN=Users,${DOMAINDN}
+objectClass: top
+objectClass: group
+description: All workstations and servers joined to the domain
+objectSid: ${DOMAINSID}-515
+sAMAccountName: Domain Computers
+isCriticalSystemObject: TRUE
+
+dn: CN=Domain Controllers,CN=Users,${DOMAINDN}
+objectClass: top
+objectClass: group
+description: All domain controllers in the domain
+objectSid: ${DOMAINSID}-516
+adminCount: 1
+sAMAccountName: Domain Controllers
+isCriticalSystemObject: TRUE
+
# Add users
dn: CN=Administrator,CN=Users,${DOMAINDN}
@@ -67,23 +85,6 @@ adminCount: 1
sAMAccountName: Enterprise Admins
isCriticalSystemObject: TRUE
-dn: CN=Domain Computers,CN=Users,${DOMAINDN}
-objectClass: top
-objectClass: group
-description: All workstations and servers joined to the domain
-objectSid: ${DOMAINSID}-515
-sAMAccountName: Domain Computers
-isCriticalSystemObject: TRUE
-
-dn: CN=Domain Controllers,CN=Users,${DOMAINDN}
-objectClass: top
-objectClass: group
-description: All domain controllers in the domain
-objectSid: ${DOMAINSID}-516
-adminCount: 1
-sAMAccountName: Domain Controllers
-isCriticalSystemObject: TRUE
-
dn: CN=Schema Admins,CN=Users,${DOMAINDN}
objectClass: top
objectClass: group
@@ -212,30 +213,6 @@ adminCount: 1
sAMAccountName: Administrators
systemFlags: -1946157056
groupType: -2147483643
-privilege: SeSecurityPrivilege
-privilege: SeBackupPrivilege
-privilege: SeRestorePrivilege
-privilege: SeSystemtimePrivilege
-privilege: SeShutdownPrivilege
-privilege: SeRemoteShutdownPrivilege
-privilege: SeTakeOwnershipPrivilege
-privilege: SeDebugPrivilege
-privilege: SeSystemEnvironmentPrivilege
-privilege: SeSystemProfilePrivilege
-privilege: SeProfileSingleProcessPrivilege
-privilege: SeIncreaseBasePriorityPrivilege
-privilege: SeLoadDriverPrivilege
-privilege: SeCreatePagefilePrivilege
-privilege: SeIncreaseQuotaPrivilege
-privilege: SeChangeNotifyPrivilege
-privilege: SeUndockPrivilege
-privilege: SeManageVolumePrivilege
-privilege: SeImpersonatePrivilege
-privilege: SeCreateGlobalPrivilege
-privilege: SeEnableDelegationPrivilege
-privilege: SeInteractiveLogonRight
-privilege: SeNetworkLogonRight
-privilege: SeRemoteInteractiveLogonRight
isCriticalSystemObject: TRUE
dn: CN=Users,CN=Builtin,${DOMAINDN}
@@ -272,9 +249,6 @@ adminCount: 1
sAMAccountName: Print Operators
systemFlags: -1946157056
groupType: -2147483643
-privilege: SeLoadDriverPrivilege
-privilege: SeShutdownPrivilege
-privilege: SeInteractiveLogonRight
isCriticalSystemObject: TRUE
dn: CN=Backup Operators,CN=Builtin,${DOMAINDN}
@@ -286,10 +260,6 @@ adminCount: 1
sAMAccountName: Backup Operators
systemFlags: -1946157056
groupType: -2147483643
-privilege: SeBackupPrivilege
-privilege: SeRestorePrivilege
-privilege: SeShutdownPrivilege
-privilege: SeInteractiveLogonRight
isCriticalSystemObject: TRUE
dn: CN=Replicator,CN=Builtin,${DOMAINDN}
@@ -353,12 +323,6 @@ adminCount: 1
sAMAccountName: Server Operators
systemFlags: -1946157056
groupType: -2147483643
-privilege: SeBackupPrivilege
-privilege: SeSystemtimePrivilege
-privilege: SeRemoteShutdownPrivilege
-privilege: SeRestorePrivilege
-privilege: SeShutdownPrivilege
-privilege: SeInteractiveLogonRight
isCriticalSystemObject: TRUE
dn: CN=Account Operators,CN=Builtin,${DOMAINDN}
@@ -370,7 +334,6 @@ adminCount: 1
sAMAccountName: Account Operators
systemFlags: -1946157056
groupType: -2147483643
-privilege: SeInteractiveLogonRight
isCriticalSystemObject: TRUE
dn: CN=Pre-Windows 2000 Compatible Access,CN=Builtin,${DOMAINDN}
@@ -382,8 +345,6 @@ objectSid: S-1-5-32-554
sAMAccountName: Pre-Windows 2000 Compatible Access
systemFlags: -1946157056
groupType: -2147483643
-privilege: SeRemoteInteractiveLogonRight
-privilege: SeChangeNotifyPrivilege
isCriticalSystemObject: TRUE
dn: CN=Incoming Forest Trust Builders,CN=Builtin,${DOMAINDN}
diff --git a/source4/setup/pwsettings b/source4/setup/pwsettings
index 0bb39d9757..59ed5d29bf 100755
--- a/source4/setup/pwsettings
+++ b/source4/setup/pwsettings
@@ -41,8 +41,8 @@ credopts = options.CredentialsOptions(parser)
parser.add_option_group(credopts)
parser.add_option("-H", help="LDB URL for database or target server", type=str)
parser.add_option("--quiet", help="Be quiet", action="store_true")
-parser.add_option("--complexity",
- help="The password complexity (on | off | default). Default is 'on'", type=str)
+parser.add_option("--complexity", type="choice", choices=["on","off","default"],
+ help="The password complexity (on | off | default). Default is 'on'")
parser.add_option("--history-length",
help="The password history length (<integer> | default). Default is 24.", type=str)
parser.add_option("--min-pwd-length",
@@ -87,10 +87,10 @@ try:
# ticks -> days
min_pwd_age = int(abs(int(res[0]["minPwdAge"][0])) / (1e7 * 60 * 60 * 24))
max_pwd_age = int(abs(int(res[0]["maxPwdAge"][0])) / (1e7 * 60 * 60 * 24))
-except:
- print "ERROR: Could not retrieve password properties!"
+except KeyError:
+ print >>sys.stderr, "ERROR: Could not retrieve password properties!"
if args[0] == "show":
- print "So no settings can be displayed!"
+ print >>sys.stderr, "So no settings can be displayed!"
sys.exit(1)
if args[0] == "show":
@@ -118,9 +118,6 @@ elif args[0] == "set":
elif opts.complexity == "off":
pwd_props = pwd_props & (~DOMAIN_PASSWORD_COMPLEX)
msgs.append("Password complexity deactivated!")
- else:
- print "ERROR: Wrong argument '" + opts.complexity + "'!"
- sys.exit(1)
m["pwdProperties"] = ldb.MessageElement(str(pwd_props),
ldb.FLAG_MOD_REPLACE, "pwdProperties")
@@ -132,7 +129,7 @@ elif args[0] == "set":
pwd_hist_len = int(opts.history_length)
if pwd_hist_len < 0 or pwd_hist_len > 24:
- print "ERROR: Password history length must be in the range of 0 to 24!"
+ print >>sys.stderr, "ERROR: Password history length must be in the range of 0 to 24!"
sys.exit(1)
m["pwdHistoryLength"] = ldb.MessageElement(str(pwd_hist_len),
@@ -146,7 +143,7 @@ elif args[0] == "set":
min_pwd_len = int(opts.min_pwd_length)
if min_pwd_len < 0 or min_pwd_len > 14:
- print "ERROR: Minimum password length must be in the range of 0 to 14!"
+ print >>sys.stderr, "ERROR: Minimum password length must be in the range of 0 to 14!"
sys.exit(1)
m["minPwdLength"] = ldb.MessageElement(str(min_pwd_len),
@@ -160,7 +157,7 @@ elif args[0] == "set":
min_pwd_age = int(opts.min_pwd_age)
if min_pwd_age < 0 or min_pwd_age > 998:
- print "ERROR: Minimum password age must be in the range of 0 to 998!"
+ print >>sys.stderr, "ERROR: Minimum password age must be in the range of 0 to 998!"
sys.exit(1)
# days -> ticks
@@ -177,7 +174,7 @@ elif args[0] == "set":
max_pwd_age = int(opts.max_pwd_age)
if max_pwd_age < 0 or max_pwd_age > 999:
- print "ERROR: Maximum password age must be in the range of 0 to 999!"
+ print >>sys.stderr, "ERROR: Maximum password age must be in the range of 0 to 999!"
sys.exit(1)
# days -> ticks
@@ -197,5 +194,5 @@ elif args[0] == "set":
message("\n".join(msgs))
else:
- print "ERROR: Wrong argument '" + args[0] + "'!"
+ print >>sys.stderr, "ERROR: Wrong argument '" + args[0] + "'!"
sys.exit(1)
diff --git a/source4/setup/schema_samba4.ldif b/source4/setup/schema_samba4.ldif
index f447bf5617..76b31f0cd7 100644
--- a/source4/setup/schema_samba4.ldif
+++ b/source4/setup/schema_samba4.ldif
@@ -121,19 +121,20 @@
#attributeSyntax: 2.5.5.4
#oMSyntax: 20
-dn: cn=privilege,${SCHEMADN}
-objectClass: top
-objectClass: attributeSchema
-cn: privilege
-lDAPDisplayName: privilege
-isSingleValued: FALSE
-systemFlags: 17
-systemOnly: TRUE
-schemaIDGUID: 7429BC94-CC6A-4481-8B2C-A97E316EB182
-adminDisplayName: Privilege
-attributeID: 1.3.6.1.4.1.7165.4.1.7
-attributeSyntax: 2.5.5.4
-oMSyntax: 20
+# not used anymore
+#dn: cn=privilege,${SCHEMADN}
+#objectClass: top
+#objectClass: attributeSchema
+#cn: privilege
+#lDAPDisplayName: privilege
+#isSingleValued: FALSE
+#systemFlags: 17
+#systemOnly: TRUE
+#schemaIDGUID: 7429BC94-CC6A-4481-8B2C-A97E316EB182
+#adminDisplayName: Privilege
+#attributeID: 1.3.6.1.4.1.7165.4.1.7
+#attributeSyntax: 2.5.5.4
+#oMSyntax: 20
#
# Not used anymore
@@ -197,26 +198,29 @@ oMSyntax: 20
# Based on domainDNS, but without the DNS bits.
#
-dn: CN=Samba4-Local-Domain,${SCHEMADN}
-objectClass: top
-objectClass: classSchema
-cn: Samba4-Local-Domain
-subClassOf: top
-governsID: 1.3.6.1.4.1.7165.4.2.2
-rDNAttID: cn
-adminDisplayName: Samba4-Local-Domain
-adminDescription: Samba4-Local-Domain
-systemMayContain: msDS-Behavior-Version
-systemMayContain: managedBy
-objectClassCategory: 1
-lDAPDisplayName: samba4LocalDomain
-schemaIDGUID: 07be1647-8310-4fba-91ae-34e55d5a8293
-systemOnly: FALSE
-systemAuxiliaryClass: samDomain
-defaultSecurityDescriptor: D:(A;;RPLCLORC;;;DA)(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)(A;;RPLCLORC;;;AU)
-systemFlags: 16
-defaultHidingValue: TRUE
-defaultObjectCategory: CN=Samba4-Local-Domain,${SCHEMADN}
+#
+# Not used anymore
+#
+#dn: CN=Samba4-Local-Domain,${SCHEMADN}
+#objectClass: top
+#objectClass: classSchema
+#cn: Samba4-Local-Domain
+#subClassOf: top
+#governsID: 1.3.6.1.4.1.7165.4.2.2
+#rDNAttID: cn
+#adminDisplayName: Samba4-Local-Domain
+#adminDescription: Samba4-Local-Domain
+#systemMayContain: msDS-Behavior-Version
+#systemMayContain: managedBy
+#objectClassCategory: 1
+#lDAPDisplayName: samba4LocalDomain
+#schemaIDGUID: 07be1647-8310-4fba-91ae-34e55d5a8293
+#systemOnly: FALSE
+#systemAuxiliaryClass: samDomain
+#defaultSecurityDescriptor: D:(A;;RPLCLORC;;;DA)(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)(A;;RPLCLORC;;;AU)
+#systemFlags: 16
+#defaultHidingValue: TRUE
+#defaultObjectCategory: CN=Samba4-Local-Domain,${SCHEMADN}
dn: CN=Samba4Top,${SCHEMADN}
@@ -313,32 +317,9 @@ systemMayContain: adminDescription
systemMustContain: objectCategory
systemMustContain: nTSecurityDescriptor
systemMustContain: instanceType
-systemAuxiliaryClass: samba4TopExtra
defaultSecurityDescriptor: D:(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;DA)(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)(A;;RPLCLORC;;;AU)
systemFlags: 16
defaultHidingValue: TRUE
objectCategory: CN=Class-Schema,${SCHEMADN}
defaultObjectCategory: CN=Samba4Top,${SCHEMADN}
-
-dn: CN=Samba4TopExtra,${SCHEMADN}
-objectClass: top
-objectClass: classSchema
-cn: Samba4TopExtra
-subClassOf: top
-governsID: 1.3.6.1.4.1.7165.4.2.3
-rDNAttID: cn
-adminDisplayName: Samba4TopExtra
-adminDescription: Attributes used in top in Samba4 that OpenLDAP does not
-objectClassCategory: 2
-lDAPDisplayName: samba4TopExtra
-schemaIDGUID: 073598d0-635b-4685-a929-da731b98d84e
-systemOnly: TRUE
-mayContain: privilege
-systemPossSuperiors: lostAndFound
-defaultSecurityDescriptor: D:(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;DA)(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)(A;;RPLCLORC;;;AU)
-systemFlags: 16
-defaultHidingValue: TRUE
-objectCategory: CN=Class-Schema,${SCHEMADN}
-defaultObjectCategory: CN=Samba4TopExtra,${SCHEMADN}
-