selftest:Samba3: provision the domain adminstrators group in the s3 environments
authorMichael Adam <obnox@samba.org>
Tue, 20 Nov 2012 15:48:23 +0000 (16:48 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 3 Dec 2012 07:48:23 +0000 (08:48 +0100)
I discovered that this sid / mapping is missing by working with the Sids2Uids
code and test. I do even wonder why this test could succeed prior to my pending
changes to the winbindd sids-to-xids code, for example against the s3:local
environment, since the test tries to map the sid <domsid>-512.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
selftest/target/Samba3.pm

index 28669aa89ceac14926fbbe8c531726549d822e2c..04fe8ee6cf0023eb6a47bb37ed8af7a48d744463 100755 (executable)
@@ -816,7 +816,7 @@ sub provision($$$$$$)
 
        my ($max_uid, $max_gid);
        my ($uid_nobody, $uid_root, $uid_pdbtest);
-       my ($gid_nobody, $gid_nogroup, $gid_root, $gid_domusers);
+       my ($gid_nobody, $gid_nogroup, $gid_root, $gid_domusers, $gid_domadmins);
 
        if ($unix_uid < 0xffff - 2) {
                $max_uid = 0xffff;
@@ -838,6 +838,7 @@ sub provision($$$$$$)
        $gid_nogroup = $max_gid - 2;
        $gid_root = $max_gid - 3;
        $gid_domusers = $max_gid - 4;
+       $gid_domadmins = $max_gid - 5;
 
        ##
        ## create conffile
@@ -1041,6 +1042,7 @@ pdbtest:x:$uid_pdbtest:$gid_nogroup:pdbtest gecos:$prefix_abs:/bin/false
 nogroup:x:$gid_nogroup:nobody
 $unix_name-group:x:$unix_gids[0]:
 domusers:X:$gid_domusers:
+domadmins:X:$gid_domadmins:
 ";
        if ($unix_gids[0] != 0) {
                print GROUP "root:x:$gid_root:";
@@ -1142,6 +1144,10 @@ sub wait_for_start($$)
        if ($ret != 0) {
            return 1;
        }
+       $ret = system(Samba::bindir_path($self, "net") ." $envvars->{CONFIGURATION} groupmap add rid=512 unixgroup=domadmins type=domain");
+       if ($ret != 0) {
+           return 1;
+       }
 
        print $self->getlog_env($envvars);