selftest: Fix specification of --machinepass to actually set a unique password
authorAndrew Bartlett <abartlet@samba.org>
Thu, 28 Feb 2013 11:57:45 +0000 (22:57 +1100)
committerJeremy Allison <jra@samba.org>
Wed, 6 Mar 2013 22:46:29 +0000 (14:46 -0800)
Because perl does not assert on dereferencing an invalid hash key
we did not notice that the passwords were being set to machine, not
machineloCalMemberPass.

Andrew Bartlett
Reviewed-by: Jeremy Allison <jra@samba.org>
selftest/target/Samba4.pm

index e9e0037..05541d9 100644 (file)
@@ -881,7 +881,7 @@ sub provision_member($$$)
        $cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
        $cmd .= "$samba_tool domain join $ret->{CONFIGURATION} $dcvars->{REALM} member";
        $cmd .= " -U$dcvars->{DC_USERNAME}\%$dcvars->{DC_PASSWORD}";
-       $cmd .= " --machinepass=machine$ret->{password}";
+       $cmd .= " --machinepass=machine$ret->{PASSWORD}";
 
        unless (system($cmd) == 0) {
                warn("Join failed\n$cmd");
@@ -949,7 +949,7 @@ sub provision_rpc_proxy($$$)
        $cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
        $cmd .= "$samba_tool domain join $ret->{CONFIGURATION} $dcvars->{REALM} member";
        $cmd .= " -U$dcvars->{DC_USERNAME}\%$dcvars->{DC_PASSWORD}";
-       $cmd .= " --machinepass=machine$ret->{password}";
+       $cmd .= " --machinepass=machine$ret->{PASSWORD}";
 
        unless (system($cmd) == 0) {
                warn("Join failed\n$cmd");
@@ -1036,7 +1036,7 @@ sub provision_promoted_dc($$$)
        $cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
        $cmd .= "$samba_tool domain join $ret->{CONFIGURATION} $dcvars->{REALM} MEMBER --realm=$dcvars->{REALM}";
        $cmd .= " -U$dcvars->{DC_USERNAME}\%$dcvars->{DC_PASSWORD}";
-       $cmd .= " --machinepass=machine$ret->{password}";
+       $cmd .= " --machinepass=machine$ret->{PASSWORD}";
 
        unless (system($cmd) == 0) {
                warn("Join failed\n$cmd");
@@ -1049,7 +1049,7 @@ sub provision_promoted_dc($$$)
        $cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
        $cmd .= "$samba_tool domain dcpromo $ret->{CONFIGURATION} $dcvars->{REALM} DC --realm=$dcvars->{REALM}";
        $cmd .= " -U$dcvars->{DC_USERNAME}\%$dcvars->{DC_PASSWORD}";
-       $cmd .= " --machinepass=machine$ret->{password} --use-ntvfs";
+       $cmd .= " --machinepass=machine$ret->{PASSWORD} --use-ntvfs";
 
        unless (system($cmd) == 0) {
                warn("Join failed\n$cmd");
@@ -1110,7 +1110,7 @@ sub provision_vampire_dc($$$)
        $cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
        $cmd .= "$samba_tool domain join $ret->{CONFIGURATION} $dcvars->{REALM} DC --realm=$dcvars->{REALM}";
        $cmd .= " -U$dcvars->{DC_USERNAME}\%$dcvars->{DC_PASSWORD} --domain-critical-only";
-       $cmd .= " --machinepass=machine$ret->{password} --use-ntvfs";
+       $cmd .= " --machinepass=machine$ret->{PASSWORD} --use-ntvfs";
 
        unless (system($cmd) == 0) {
                warn("Join failed\n$cmd");
@@ -1175,7 +1175,7 @@ sub provision_subdom_dc($$$)
        $cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
        $cmd .= "$samba_tool domain join $ret->{CONFIGURATION} $ctx->{realm} subdomain ";
        $cmd .= "--parent-domain=$dcvars->{REALM} -U$dcvars->{DC_USERNAME}\@$dcvars->{REALM}\%$dcvars->{DC_PASSWORD}";
-       $cmd .= " --machinepass=machine$ret->{password} --use-ntvfs";
+       $cmd .= " --machinepass=machine$ret->{PASSWORD} --use-ntvfs";
 
        unless (system($cmd) == 0) {
                warn("Join failed\n$cmd");