selftest: Avoid system krb5.conf in some test envs that don't use kerberos
authorUri Simchoni <uri@samba.org>
Sun, 25 Oct 2015 13:02:17 +0000 (15:02 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 26 Oct 2015 23:28:34 +0000 (00:28 +0100)
Some test envs don't use kerberos (e.g. nt4_dc). However, the client
tools are built with Kerberos support and may get upset if hitting
a krb5.conf file they don't understand.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/target/Samba3.pm

index 15423fef3d5e90fac22068ec53564196ace06a1b..f66aea75b31968e61f882f4d4afbbbee5d252ce6 100755 (executable)
@@ -172,6 +172,13 @@ sub setup_env($$$)
                return $self->{vars}->{$envname};
        }
 
+       #
+       # Avoid hitting system krb5.conf -
+       # An env that needs Kerberos will reset this to the real
+       # value.
+       #
+       $ENV{KRB5_CONFIG} = "$path/no_krb5.conf";
+
        if ($envname eq "nt4_dc") {
                return $self->setup_nt4_dc("$path/nt4_dc");
        } elsif ($envname eq "nt4_dc_schannel") {
@@ -1632,6 +1639,13 @@ userdup:x:$gid_userdup:$unix_name
        $ret{LOCAL_PATH} = "$shrdir";
         $ret{LOGDIR} = $logdir;
 
+       #
+       # Avoid hitting system krb5.conf -
+       # An env that needs Kerberos will reset this to the real
+       # value.
+       #
+       $ret{KRB5_CONFIG} = abs_path($prefix) . "/no_krb5.conf";
+
        return \%ret;
 }