summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsource4/script/tests/selftest.sh4
-rw-r--r--source4/setup/provision.ldif2
-rwxr-xr-xsource4/setup/provision.pl13
3 files changed, 16 insertions, 3 deletions
diff --git a/source4/script/tests/selftest.sh b/source4/script/tests/selftest.sh
index 4f3233a917..880a2f097b 100755
--- a/source4/script/tests/selftest.sh
+++ b/source4/script/tests/selftest.sh
@@ -3,6 +3,7 @@ DOMAIN=SAMBADOMAIN
USERNAME=administrator
REALM=$DOMAIN
PASSWORD=penguin
+ROOT=$USER
SRCDIR=`pwd`
if [ $# -lt 1 ]
@@ -38,7 +39,8 @@ incdir=`dirname $0`
rm -rf $PREFIX/*
mkdir -p $PRIVATEDIR $LIBDIR $PIDDIR $NCALRPCDIR $LOCKDIR $TMPDIR
-./setup/provision.pl --quiet --outputdir $PRIVATEDIR --domain $DOMAIN --realm $REALM --adminpass $PASSWORD
+./setup/provision.pl --quiet --outputdir $PRIVATEDIR --domain $DOMAIN --realm $REALM \
+ --adminpass $PASSWORD --root=$ROOT
cat >$CONFFILE<<EOF
[global]
diff --git a/source4/setup/provision.ldif b/source4/setup/provision.ldif
index 131ebe2b42..c98a6153e0 100644
--- a/source4/setup/provision.ldif
+++ b/source4/setup/provision.ldif
@@ -298,7 +298,7 @@ sAMAccountType: 0x30000000
objectCategory: CN=Person,CN=Schema,CN=Configuration,${BASEDN}
isCriticalSystemObject: TRUE
unicodePwd: ${ADMINPASS}
-unixName: root
+unixName: ${ROOT}
dn: CN=Guest,CN=Users,${BASEDN}
objectClass: top
diff --git a/source4/setup/provision.pl b/source4/setup/provision.pl
index a87f2aef54..fccc555ce1 100755
--- a/source4/setup/provision.pl
+++ b/source4/setup/provision.pl
@@ -10,6 +10,7 @@ my $opt_hostip;
my $opt_realm;
my $opt_domain;
my $opt_adminpass;
+my $opt_root;
my $opt_nobody;
my $opt_nogroup;
my $opt_wheel;
@@ -171,6 +172,10 @@ sub substitute($)
return $opt_nobody;
}
+ if ($var eq "ROOT") {
+ return $opt_root;
+ }
+
if ($var eq "NOGROUP") {
return $opt_nogroup;
}
@@ -278,6 +283,7 @@ provision.pl [options]
--invocationid GUID set invocationid (otherwise random)
--outputdir OUTPUTDIR set output directory
--adminpass PASSWORD choose admin password (otherwise random)
+ --root USERNAME choose 'root' unix username
--nobody USERNAME choose 'nobody' user
--nogroup GROUPNAME choose 'nogroup' group
--wheel GROUPNAME choose 'wheel' privileged group
@@ -303,6 +309,7 @@ GetOptions(
'host-guid=s' => \$opt_hostguid,
'invocationid=s' => \$opt_invocationid,
'adminpass=s' => \$opt_adminpass,
+ 'root=s' => \$opt_root,
'nobody=s' => \$opt_nobody,
'nogroup=s' => \$opt_nogroup,
'wheel=s' => \$opt_wheel,
@@ -334,6 +341,10 @@ if (!$opt_hostip) {
$opt_quiet or print "Provisioning host '$opt_hostname'[$opt_hostip] for domain '$opt_domain' in realm '$opt_realm'\n";
+if (!$opt_root) {
+ $opt_root = "root";
+}
+
if (!$opt_nobody) {
if (defined getpwnam("nobody")) {
$opt_nobody = "nobody";
@@ -380,7 +391,7 @@ my $data = FileLoad("setup/provision.ldif") || die "Unable to load provision.ldi
$data .= add_foreign("S-1-5-7", "Anonymous", "\${NOBODY}");
$data .= add_foreign("S-1-1-0", "World", "\${NOGROUP}");
$data .= add_foreign("S-1-5-2", "Network", "\${NOGROUP}");
-$data .= add_foreign("S-1-5-18", "System", "root");
+$data .= add_foreign("S-1-5-18", "System", "\${ROOT}");
$data .= add_foreign("S-1-5-11", "Authenticated Users", "\${USERS}");
if (!$opt_adminpass) {