r7499: ensure that the account we run tests as ("Administrator") maps to the
authorAndrew Tridgell <tridge@samba.org>
Sun, 12 Jun 2005 06:35:18 +0000 (06:35 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:18:00 +0000 (13:18 -0500)
unixName that we are running as in the test suite. Otherwise files are
created as a user without any entry in the sam, so the ACL doesn't
allow that user read permission when it should. This should fix the
RAW-ACLS test in the build farm.
(This used to be commit 30445483e4facb0a1d8a5979a2eac6c166193c09)

source4/script/tests/selftest.sh
source4/setup/provision.ldif
source4/setup/provision.pl

index 4f3233a91743880e013768ba1ca614c6abbb12e2..880a2f097bc4bad8cfb27d9d0d9518d2e1078009 100755 (executable)
@@ -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]
index 131ebe2b4265e403440504d3a187690404a00330..c98a6153e0e0b420edaaa4be873c793424559188 100644 (file)
@@ -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
index a87f2aef54ba3d5465d2aad96ce3e7dd25570451..fccc555ce16e115d618e92cbc27b409dd5f96701 100755 (executable)
@@ -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) {