]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
selftest: set wrapper env variables when running net groupmap
authorRalph Boehme <slow@samba.org>
Mon, 8 Jan 2018 13:28:40 +0000 (14:28 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 10 Jan 2018 00:01:24 +0000 (01:01 +0100)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
selftest/target/Samba3.pm

index 2c2e8f99356f7a15ba3860170d2df25556c96f42..df96fd18f5562cac3761d67592a06a42b2b6b5a3 100755 (executable)
@@ -2334,6 +2334,7 @@ sub wait_for_start($$$$$)
 {
        my ($self, $envvars, $nmbd, $winbindd, $smbd) = @_;
        my $cmd;
+       my $netcmd;
        my $ret;
 
        if ($nmbd eq "yes") {
@@ -2406,17 +2407,29 @@ sub wait_for_start($$$$$)
        }
 
        # Ensure we have domain users mapped.
-       $ret = system(Samba::bindir_path($self, "net") ." $envvars->{CONFIGURATION} groupmap add rid=513 unixgroup=domusers type=domain");
+       $netcmd = "NSS_WRAPPER_PASSWD='$envvars->{NSS_WRAPPER_PASSWD}' ";
+       $netcmd .= "NSS_WRAPPER_GROUP='$envvars->{NSS_WRAPPER_GROUP}' ";
+       $netcmd .= Samba::bindir_path($self, "net") ." $envvars->{CONFIGURATION} ";
+
+       $cmd = $netcmd . "groupmap add rid=513 unixgroup=domusers type=domain";
+       $ret = system($cmd);
        if ($ret != 0) {
-           return 1;
+               print("\"$cmd\" failed\n");
+               return 1;
        }
-       $ret = system(Samba::bindir_path($self, "net") ." $envvars->{CONFIGURATION} groupmap add rid=512 unixgroup=domadmins type=domain");
+
+       $cmd = $netcmd . "groupmap add rid=512 unixgroup=domadmins type=domain";
+       $ret = system($cmd);
        if ($ret != 0) {
-           return 1;
+               print("\"$cmd\" failed\n");
+               return 1;
        }
-       $ret = system(Samba::bindir_path($self, "net") ." $envvars->{CONFIGURATION} groupmap add sid=S-1-1-0 unixgroup=everyone type=builtin");
+
+       $cmd = $netcmd . "groupmap add sid=S-1-1-0 unixgroup=everyone type=builtin";
+       $ret = system($cmd);
        if ($ret != 0) {
-           return 1;
+               print("\"$cmd\" failed\n");
+               return 1;
        }
 
        # note: creating builtin groups requires winbindd for the