summaryrefslogtreecommitdiff
path: root/source4/setup
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-04-25 10:04:20 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-04-25 10:04:20 +0100
commitcc9c4aaa8d02c4c31c9e9a4bb53e5941683fcc31 (patch)
treed0b116699dee35372ed335834989e1c885e8f94a /source4/setup
parentd1432d617e6ed04c33ca214d7f3b0099bdf53065 (diff)
parent240d959005f5fd80a38b3734b39dd5d6e425a566 (diff)
downloadsamba-cc9c4aaa8d02c4c31c9e9a4bb53e5941683fcc31.tar.gz
samba-cc9c4aaa8d02c4c31c9e9a4bb53e5941683fcc31.tar.bz2
samba-cc9c4aaa8d02c4c31c9e9a4bb53e5941683fcc31.zip
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-gmake3
Conflicts: source/Makefile source/auth/config.mk source/auth/gensec/config.mk source/build/m4/public.m4 source/build/make/python.mk source/build/make/rules.mk source/build/smb_build/header.pm source/build/smb_build/main.pl source/build/smb_build/makefile.pm source/dsdb/config.mk source/dsdb/samdb/ldb_modules/config.mk source/kdc/config.mk source/lib/events/config.mk source/lib/events/events.c source/lib/ldb/config.mk source/lib/nss_wrapper/config.mk source/lib/policy/config.mk source/lib/util/config.mk source/libcli/smb2/config.mk source/libnet/config.mk source/librpc/config.mk source/nbt_server/config.mk source/ntptr/ntptr_base.c source/ntvfs/posix/config.mk source/ntvfs/sysdep/config.mk source/param/config.mk source/rpc_server/config.mk source/rpc_server/service_rpc.c source/scripting/ejs/config.mk source/scripting/python/config.mk source/smb_server/config.mk source/smbd/server.c source/torture/config.mk source/torture/smb2/config.mk source/wrepl_server/config.mk (This used to be commit 13bbd420681519894a4036729c43273912c9b402)
Diffstat (limited to 'source4/setup')
-rw-r--r--source4/setup/idmap_init.ldif5
-rwxr-xr-xsource4/setup/newuser10
-rwxr-xr-xsource4/setup/provision2
-rwxr-xr-xsource4/setup/provision-backend15
-rw-r--r--source4/setup/provision.ldif4
-rw-r--r--source4/setup/provision_basedn_modify.ldif2
-rw-r--r--source4/setup/provision_configuration.ldif2
-rw-r--r--source4/setup/provision_rootdse_add.ldif5
-rw-r--r--source4/setup/provision_schema_basedn_modify.ldif2
-rw-r--r--source4/setup/provision_self_join.ldif4
-rw-r--r--source4/setup/setpassword8
-rwxr-xr-xsource4/setup/tests/blackbox_provision.sh5
12 files changed, 32 insertions, 32 deletions
diff --git a/source4/setup/idmap_init.ldif b/source4/setup/idmap_init.ldif
index a397cfd0d2..43e5b65562 100644
--- a/source4/setup/idmap_init.ldif
+++ b/source4/setup/idmap_init.ldif
@@ -1,5 +1,4 @@
dn: CN=CONFIG
cn: CONFIG
-lowerBound: 10000
-upperBound: 20000
-
+lowerBound: 3000000
+upperBound: 4000000
diff --git a/source4/setup/newuser b/source4/setup/newuser
index f622058a5d..04a5440ee1 100755
--- a/source4/setup/newuser
+++ b/source4/setup/newuser
@@ -45,15 +45,9 @@ else:
if opts.unixname is None:
opts.unixname = username
-try:
- pwd.getpwnam(opts.unixname)
-except KeyError:
- print "ERROR: Unix user '%s' does not exist" % opts.unixname
- sys.exit(1)
-
-creds = credopts.get_credentials()
-
lp = sambaopts.get_loadparm()
+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)
diff --git a/source4/setup/provision b/source4/setup/provision
index 259bd814a4..b748dab339 100755
--- a/source4/setup/provision
+++ b/source4/setup/provision
@@ -35,6 +35,8 @@ from samba.provision import (provision,
FILL_FULL, FILL_NT4SYNC,
FILL_DRS)
+# how do we make this case insensitive??
+
parser = optparse.OptionParser("provision [options]")
sambaopts = options.SambaOptions(parser)
parser.add_option_group(sambaopts)
diff --git a/source4/setup/provision-backend b/source4/setup/provision-backend
index ada6dcef8d..4f222c467a 100755
--- a/source4/setup/provision-backend
+++ b/source4/setup/provision-backend
@@ -54,6 +54,8 @@ parser.add_option("--quiet", help="Be quiet", action="store_true")
parser.add_option("--ldap-backend-type", type="choice", metavar="LDAP-BACKEND-TYPE",
help="LDB mapping module to use for the LDAP backend",
choices=["fedora-ds", "openldap"])
+parser.add_option("--ldap-backend-port", type="int", metavar="PORT",
+ help="TCP Port LDAP server should listen to (default ldapi only)")
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)")
@@ -89,10 +91,9 @@ if setup_dir is None:
setup_dir = "setup"
provision_backend(setup_dir=setup_dir, message=message, smbconf=smbconf, targetdir=opts.targetdir,
- realm=opts.realm, domain=opts.domain,
- hostname=opts.host_name,
- adminpass=opts.ldap_manager_pass,
- root=opts.root, serverrole=server_role,
- ldap_backend_type=opts.ldap_backend_type)
-
-message("All OK")
+ realm=opts.realm, domain=opts.domain,
+ hostname=opts.host_name,
+ adminpass=opts.ldap_manager_pass,
+ root=opts.root, serverrole=server_role,
+ ldap_backend_type=opts.ldap_backend_type,
+ ldap_backend_port=opts.ldap_backend_port)
diff --git a/source4/setup/provision.ldif b/source4/setup/provision.ldif
index 37b6bdaa60..2f734e83b2 100644
--- a/source4/setup/provision.ldif
+++ b/source4/setup/provision.ldif
@@ -30,7 +30,7 @@ objectclass: rIDManager
cn: RID Manager$
systemFlags: 2348810240
isCriticalSystemObject: TRUE
-fSMORoleOwner: CN=NTDS Settings,CN=${NETBIOSNAME},CN=Servers,CN=${DEFAULTSITE},CN=Sites,${CONFIGDN}
+fSMORoleOwner: CN=NTDS Settings,${SERVERDN}
rIDAvailablePool: 4611686014132423217
dn: CN=DomainUpdates,CN=System,${DOMAINDN}
@@ -50,7 +50,7 @@ objectclass: infrastructureUpdate
cn: Infrastructure
systemFlags: 2348810240
isCriticalSystemObject: TRUE
-fSMORoleOwner: CN=NTDS Settings,CN=${NETBIOSNAME},CN=Servers,CN=${DEFAULTSITE},CN=Sites,${CONFIGDN}
+fSMORoleOwner: CN=NTDS Settings,${SERVERDN}
dn: CN=Builtin,${DOMAINDN}
objectClass: top
diff --git a/source4/setup/provision_basedn_modify.ldif b/source4/setup/provision_basedn_modify.ldif
index dadfda720e..f5e1bb5add 100644
--- a/source4/setup/provision_basedn_modify.ldif
+++ b/source4/setup/provision_basedn_modify.ldif
@@ -65,7 +65,7 @@ replace: objectCategory
objectCategory: CN=Domain-DNS,${SCHEMADN}
-
replace: fSMORoleOwner
-fSMORoleOwner: CN=NTDS Settings,CN=${NETBIOSNAME},CN=Servers,CN=${DEFAULTSITE},CN=Sites,${CONFIGDN}
+fSMORoleOwner: CN=NTDS Settings,${SERVERDN}
-
replace: isCriticalSystemObject
isCriticalSystemObject: TRUE
diff --git a/source4/setup/provision_configuration.ldif b/source4/setup/provision_configuration.ldif
index 0fe90b0739..2a7357d7ad 100644
--- a/source4/setup/provision_configuration.ldif
+++ b/source4/setup/provision_configuration.ldif
@@ -7,7 +7,7 @@ objectClass: crossRefContainer
cn: Partitions
systemFlags: 2147483648
msDS-Behavior-Version: 0
-fSMORoleOwner: CN=NTDS Settings,CN=${NETBIOSNAME},CN=Servers,CN=${DEFAULTSITE},CN=Sites,${CONFIGDN}
+fSMORoleOwner: CN=NTDS Settings,${SERVERDN}
dn: CN=Enterprise Configuration,CN=Partitions,${CONFIGDN}
objectClass: top
diff --git a/source4/setup/provision_rootdse_add.ldif b/source4/setup/provision_rootdse_add.ldif
index 9f19796ec6..14e0d71df6 100644
--- a/source4/setup/provision_rootdse_add.ldif
+++ b/source4/setup/provision_rootdse_add.ldif
@@ -1,7 +1,7 @@
# the rootDSE module looks in this record for its base data
dn: @ROOTDSE
subschemaSubentry: CN=Aggregate,${SCHEMADN}
-dsServiceName: CN=NTDS Settings,CN=${NETBIOSNAME},CN=Servers,CN=${DEFAULTSITE},CN=Sites,${CONFIGDN}
+dsServiceName: CN=NTDS Settings,${SERVERDN}
defaultNamingContext: ${DOMAINDN}
rootDomainNamingContext: ${ROOTDN}
configurationNamingContext: ${CONFIGDN}
@@ -9,10 +9,9 @@ schemaNamingContext: ${SCHEMADN}
supportedLDAPVersion: 3
dnsHostName: ${DNSNAME}
ldapServiceName: ${DNSDOMAIN}:${NETBIOSNAME}$@${REALM}
-serverName: CN=${NETBIOSNAME},CN=Servers,CN=${DEFAULTSITE},CN=Sites,${CONFIGDN}
+serverName: ${SERVERDN}
domainFunctionality: 0
forestFunctionality: 0
domainControllerFunctionality: 2
isSynchronized: FALSE
vendorName: Samba Team (http://samba.org)
-vendorVersion: ${VERSION}
diff --git a/source4/setup/provision_schema_basedn_modify.ldif b/source4/setup/provision_schema_basedn_modify.ldif
index 4e690376d7..4e8267a303 100644
--- a/source4/setup/provision_schema_basedn_modify.ldif
+++ b/source4/setup/provision_schema_basedn_modify.ldif
@@ -4,7 +4,7 @@
dn: ${SCHEMADN}
changetype: modify
replace: fSMORoleOwner
-fSMORoleOwner: CN=NTDS Settings,CN=${NETBIOSNAME},CN=Servers,CN=${DEFAULTSITE},CN=Sites,${CONFIGDN}
+fSMORoleOwner: CN=NTDS Settings,${SERVERDN}
-
replace: objectVersion
objectVersion: 30
diff --git a/source4/setup/provision_self_join.ldif b/source4/setup/provision_self_join.ldif
index a0cfa7eb23..c91e2f4c19 100644
--- a/source4/setup/provision_self_join.ldif
+++ b/source4/setup/provision_self_join.ldif
@@ -36,7 +36,7 @@ isCriticalSystemObject: TRUE
sambaPassword:: ${DNSPASS_B64}
showInAdvancedViewOnly: TRUE
-dn: CN=${NETBIOSNAME},CN=Servers,CN=${DEFAULTSITE},CN=Sites,${CONFIGDN}
+dn: ${SERVERDN}
objectClass: top
objectClass: server
cn: ${NETBIOSNAME}
@@ -44,7 +44,7 @@ systemFlags: 1375731712
dNSHostName: ${DNSNAME}
serverReference: CN=${NETBIOSNAME},OU=Domain Controllers,${DOMAINDN}
-dn: CN=NTDS Settings,CN=${NETBIOSNAME},CN=Servers,CN=${DEFAULTSITE},CN=Sites,${CONFIGDN}
+dn: CN=NTDS Settings,${SERVERDN}
objectClass: top
objectClass: applicationSettings
objectClass: nTDSDSA
diff --git a/source4/setup/setpassword b/source4/setup/setpassword
index 31b2f73a25..977a6a5ee8 100644
--- a/source4/setup/setpassword
+++ b/source4/setup/setpassword
@@ -36,7 +36,7 @@ if len(args) == 0:
parser.print_usage()
sys.exit(1)
-password = opts.password;
+password = opts.newpassword;
if password is None:
password = getpass("New Password: ")
@@ -47,12 +47,12 @@ if filter is None:
if username is None:
print "Either username or --filter must be specified"
- filter = "(&(objectclass=user)(samAccountName=" + username + "))"
+ filter = "(&(objectclass=user)(samAccountName=%s))" % (username)
-creds = credopts.get_credentials()
-
lp = sambaopts.get_loadparm()
+creds = credopts.get_credentials(lp)
+
samdb = SamDB(url=lp.get("sam database"), session_info=system_session(),
credentials=creds, lp=lp)
samdb.setpassword(filter, password)
diff --git a/source4/setup/tests/blackbox_provision.sh b/source4/setup/tests/blackbox_provision.sh
index 75d4fcfcb4..19f37cef2d 100755
--- a/source4/setup/tests/blackbox_provision.sh
+++ b/source4/setup/tests/blackbox_provision.sh
@@ -31,6 +31,11 @@ testit "simple-default" $PYTHON ./setup/provision $CONFIGURATION --domain=FOO --
testit "simple-dc" $PYTHON ./setup/provision $CONFIGURATION --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --targetdir=$PREFIX/simple-dc
testit "simple-member" $PYTHON ./setup/provision $CONFIGURATION --server-role="member" --domain=FOO --realm=foo.example.com --targetdir=$PREFIX/simple-member
testit "simple-standalone" $PYTHON ./setup/provision $CONFIGURATION --server-role="standalone" --domain=FOO --realm=foo.example.com --targetdir=$PREFIX/simple-standalone
+testit "blank-dc" $PYTHON ./setup/provision $CONFIGURATION --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --targetdir=$PREFIX/blank-dc --blank
+testit "partitions-only-dc" $PYTHON ./setup/provision $CONFIGURATION --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --targetdir=$PREFIX/partitions-only-dc --partitions-only
+
+testit "newuser" $PYTHON ./setup/newuser --configfile=$PREFIX/simple-dc/etc/smb.conf testuser testpass
+testit "setpassword" $PYTHON ./setup/setpassword --configfile=$PREFIX/simple-dc/etc/smb.conf testuser --newpassword=testpass
reprovision() {
$PYTHON ./setup/provision $CONFIGURATION --domain=FOO --realm=foo.example.com --targetdir="$PREFIX/reprovision"