Skip to content

Commit

Permalink
testprogs: allow to run passwords test with MIT and Heimdal kinit.
Browse files Browse the repository at this point in the history
Guenther

Signed-off-by: Guenther Deschner <[email protected]>
Reviewed-by: Andreas Schneider <[email protected]>
Reviewed-by: Andrew Bartlet <[email protected]>
  • Loading branch information
gd authored and cryptomilk committed Sep 1, 2014
1 parent 7982c37 commit af7613f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions testprogs/blackbox/test_passwords.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ test_smbclient() {
return $status
}

do_kinit() {
file="$1"
password="$2"
shift
shift
if test -x $BINDIR/samba4kinit; then
$samba4kinit --password-file=$file --request-pac $@
else
echo $password | $samba4kinit $@
fi
}

UID_WRAPPER_ROOT=1
export UID_WRAPPER_ROOT

Expand All @@ -71,15 +83,15 @@ export KRB5CCNAME

echo $USERPASS > $PREFIX/tmpuserpassfile

testit "kinit with user password" $samba4kinit --password-file=$PREFIX/tmpuserpassfile --request-pac nettestuser@$REALM || failed=`expr $failed + 1`
testit "kinit with user password" do_kinit $PREFIX/tmpuserpassfile $USERPASS nettestuser@$REALM || failed=`expr $failed + 1`

test_smbclient "Test login with user kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1`

NEWUSERPASS=testPaSS@01%
testit "change user password with 'samba-tool user password' (unforced)" $VALGRIND $samba_tool user password -W$DOMAIN -U$DOMAIN/nettestuser%$USERPASS -k no --newpassword=$NEWUSERPASS $@ || failed=`expr $failed + 1`

echo $NEWUSERPASS > ./tmpuserpassfile
testit "kinit with user password" $samba4kinit --password-file=./tmpuserpassfile --request-pac nettestuser@$REALM || failed=`expr $failed + 1`
testit "kinit with user password" do_kinit ./tmpuserpassfile $NEWUSERPASS nettestuser@$REALM || failed=`expr $failed + 1`

test_smbclient "Test login with user kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1`

Expand Down

0 comments on commit af7613f

Please sign in to comment.