shift 9
failed=0
-samba4bindir="$BINDIR"
-samba4srcdir="$SRCDIR/source4"
-samba4kinit_binary=kinit
-if test -x $BINDIR/samba4kinit; then
- samba4kinit_binary=$BINDIR/samba4kinit
-fi
+. "$(dirname "${0}")/subunit.sh"
+. "$(dirname "${0}")/common_test_fns.inc"
-samba_tool="$samba4bindir/samba-tool"
-texpect="$samba4bindir/texpect"
-samba4kpasswd=kpasswd
-if test -x $BINDIR/samba4kpasswd; then
- samba4kpasswd=$BINDIR/samba4kpasswd
-fi
+samba_bindir="$BINDIR"
+samba_srcdir="$SRCDIR/source4"
+samba_kinit=$(system_or_builddir_binary kinit "${BINDIR}" samba4kinit)
+samba_kpasswd=$(system_or_builddir_binary kpasswd "${BINDIR}" samba4kpasswd)
-enableaccount="$samba_tool user enable"
-machineaccountccache="$samba4srcdir/scripting/bin/machineaccountccache"
+samba_tool="$samba_bindir/samba-tool"
+texpect="$samba_bindir/texpect"
-. $(dirname $0)/subunit.sh
-. $(dirname $0)/common_test_fns.inc
+enableaccount="$samba_tool user enable"
+machineaccountccache="$samba_srcdir/scripting/bin/machineaccountccache"
ldbmodify=$(system_or_builddir_binary ldbmodify "${BINDIR}")
ldbsearch=$(system_or_builddir_binary ldbsearch "${BINDIR}")
KRB5CCNAME_PATH="$PREFIX/tmpccache"
KRB5CCNAME="FILE:$KRB5CCNAME_PATH"
-samba4kinit="$samba4kinit_binary -c $KRB5CCNAME"
+samba_kinit_ccache="$samba_kinit -c $KRB5CCNAME"
ADMIN_KRB5CCNAME="FILE:$KRB5CCNAME_PATH"
export KRB5CCNAME
rm -rf $KRB5CCNAME_PATH
echo $PASSWORD >$PREFIX/tmppassfile
testit "kinit with password (initial)" \
- $samba4kinit $enctype --password-file=$PREFIX/tmppassfile \
+ $samba_kinit_ccache $enctype --password-file=$PREFIX/tmppassfile \
--request-pac $USERNAME@$REALM || \
failed=$((failed + 1))
test_smbclient "Test login with user kerberos ccache" \
failed=$((failed + 1))
testit "kinit with password (enterprise style)" \
- $samba4kinit $enctype --enterprise --password-file=$PREFIX/tmppassfile \
+ $samba_kinit_ccache $enctype --enterprise --password-file=$PREFIX/tmppassfile \
--request-pac $USERNAME@$REALM || \
failed=$((failed + 1))
test_smbclient "Test login with user kerberos ccache" \
failed=$((failed + 1))
testit "kinit with password (windows style)" \
- $samba4kinit $enctype --renewable --windows \
+ $samba_kinit_ccache $enctype --renewable --windows \
--password-file=$PREFIX/tmppassfile --request-pac $USERNAME@$REALM || \
failed=$((failed + 1))
test_smbclient "Test login with user kerberos ccache" \
failed=$((failed + 1))
testit "kinit renew ticket" \
- $samba4kinit $enctype --request-pac -R
+ $samba_kinit_ccache $enctype --request-pac -R
test_smbclient "Test login with kerberos ccache" 'ls' "$unc" \
--use-krb5-ccache=$KRB5CCNAME || \
KRB5CCNAME_PATH="$PREFIX/tmpuserccache"
KRB5CCNAME="FILE:$KRB5CCNAME_PATH"
-samba4kinit="$samba4kinit_binary -c $KRB5CCNAME"
+samba_kinit_ccache="$samba_kinit -c $KRB5CCNAME"
export KRB5CCNAME
rm -f $KRB5CCNAME_PATH
testit "kinit with user password (after enable of user and password change)" \
- $samba4kinit $enctype --password-file=$PREFIX/tmpuserpassfile \
+ $samba_kinit_ccache $enctype --password-file=$PREFIX/tmpuserpassfile \
--request-pac ${TEST_USER}@$REALM || \
failed=$((failed + 1))
echo $NEWUSERPASS >$PREFIX/tmpuserpassfile
rm -f $KRB5CCNAME_PATH
testit "kinit with user password (after rpc password change)" \
- $samba4kinit $enctype --password-file=$PREFIX/tmpuserpassfile \
+ $samba_kinit_ccache $enctype --password-file=$PREFIX/tmpuserpassfile \
--request-pac ${TEST_USER}@$REALM || \
failed=$((failed + 1))
rm -f $KRB5CCNAME_PATH
testit "kinit with password (NT-Principal style) using UPN" \
- $samba4kinit $enctype --password-file=$PREFIX/tmpuserpassfile \
+ $samba_kinit_ccache $enctype --password-file=$PREFIX/tmpuserpassfile \
--request-pac nettest@$REALM || failed=$((failed + 1))
test_smbclient "Test login with user kerberos ccache from enterprise UPN" \
'ls' "$unc" --use-krb5-ccache=$KRB5CCNAME || \
rm -f $KRB5CCNAME_PATH
testit "kinit with password (enterprise style) using UPN" \
- $samba4kinit $enctype --enterprise \
+ $samba_kinit_ccache $enctype --enterprise \
--password-file=$PREFIX/tmpuserpassfile --request-pac \
nettest@$REALM || \
failed=$((failed + 1))
rm -f $KRB5CCNAME_PATH
testit "kinit with password (windows style) using UPN" \
- $samba4kinit $enctype --renewable --windows \
+ $samba_kinit_ccache $enctype --renewable --windows \
--password-file=$PREFIX/tmpuserpassfile --request-pac \
nettest@$REALM || \
failed=$((failed + 1))
rm -f $KRB5CCNAME_PATH
testit "kinit with password (enterprise style) using UPN" \
- $samba4kinit $enctype --enterprise \
+ $samba_kinit_ccache $enctype --enterprise \
--password-file=$PREFIX/tmpuserpassfile --request-pac \
nettest@$REALM.org || \
failed=$((failed + 1))
EOF
testit "change user password with kpasswd" \
- $texpect $PREFIX/tmpkpasswdscript $samba4kpasswd \
+ $texpect $PREFIX/tmpkpasswdscript $samba_kpasswd \
${TEST_USER}@$REALM || \
failed=$((failed + 1))
rm -f $KRB5CCNAME_PATH
testit "kinit with user password (after kpasswd change)" \
- $samba4kinit $enctype --password-file=$PREFIX/tmpuserpassfile \
+ $samba_kinit_ccache $enctype --password-file=$PREFIX/tmpuserpassfile \
--request-pac ${TEST_USER}@$REALM || \
failed=$((failed + 1))
EOF
testit "set user password with kpasswd" \
- $texpect $PREFIX/tmpkpasswdscript $samba4kpasswd \
+ $texpect $PREFIX/tmpkpasswdscript $samba_kpasswd \
--cache=$ADMIN_KRB5CCNAME \
${TEST_USER}@$REALM || \
failed=$((failed + 1))
rm -f $KRB5CCNAME_PATH
testit "kinit with user password (after kpasswd set)" \
- $samba4kinit $enctype --password-file=$PREFIX/tmpuserpassfile \
+ $samba_kinit_ccache $enctype --password-file=$PREFIX/tmpuserpassfile \
--request-pac ${TEST_USER}@$REALM || \
failed=$((failed + 1))
EOF
testit "set user password with kpasswd and servicePrincipalName" \
- $texpect $PREFIX/tmpkpasswdscript $samba4kpasswd \
+ $texpect $PREFIX/tmpkpasswdscript $samba_kpasswd \
--cache=$PREFIX/tmpccache host/${TEST_USER}@$REALM || \
failed=$((failed + 1))
testit "kinit with user password (after set with kpasswd and spn)" \
- $samba4kinit $enctype --password-file=$PREFIX/tmpuserpassfile \
+ $samba_kinit_ccache $enctype --password-file=$PREFIX/tmpuserpassfile \
--request-pac ${TEST_USER}@$REALM || \
failed=$((failed + 1))
testit "kinit with user password for expired password" \
$texpect $PREFIX/tmppasswordchange \
- $samba4kinit $enctype --request-pac ${TEST_USER}@$REALM || \
+ $samba_kinit_ccache $enctype --request-pac ${TEST_USER}@$REALM || \
failed=$((failed + 1))
test_smbclient "Test login with user kerberos ccache" \
echo $NEWUSERPASS >$PREFIX/tmpuserpassfile
testit "kinit with user password (after password change forced by expiration)" \
- $samba4kinit $enctype --password-file=$PREFIX/tmpuserpassfile \
+ $samba_kinit_ccache $enctype --password-file=$PREFIX/tmpuserpassfile \
--request-pac ${TEST_USER}@$REALM || \
failed=$((failed + 1))
KRB5CCNAME_PATH="$PREFIX/tmpccache"
KRB5CCNAME="FILE:$KRB5CCNAME_PATH"
-samba4kinit="$samba4kinit_binary -c $KRB5CCNAME"
+samba_kinit_ccache="$samba_kinit -c $KRB5CCNAME"
export KRB5CCNAME
rm -rf $KRB5CCNAME_PATH