Make the password used in check-kadmin.in be settable as a parameter
authorAdam Lewenberg <github238@macrotex.net>
Sat, 3 Jun 2017 22:51:17 +0000 (15:51 -0700)
committerNico Williams <nico@cryptonector.com>
Sun, 23 Dec 2018 07:33:31 +0000 (01:33 -0600)
When we use a custom patch that makes strong passwords required even for
administrators the check-kadmin test will fail because "foo" (the password
used in check-kadmin.in) is not a strong password. So, we make the
password used in check-kadmin.in settable as a parameter. This way, we
only have to change one line of check-kadmin.in rather than a dozen to get
check-kadmin to pass when using the strong-passwords everywhere patch.

Note that this change makes no real change to any of the tests in
check-kadmin.in: no tests are changed, removed, or added.

tests/kdc/check-kadmin.in

index e01a1c349cb786eee40b7ec6d9002e5b833ffbb3..72442564793dfa8e1618e38234d87e6687b1a35a 100644 (file)
@@ -59,6 +59,8 @@ kinit="${kinit} -c $cache ${afs_no_afslog}"
 kgetcred="${kgetcred} -c $cache"
 kdestroy="${kdestroy} -c $cache ${afs_no_unlog}"
 
+foopassword="foo"
+
 KRB5_CONFIG="${objdir}/krb5.conf"
 export KRB5_CONFIG
 
@@ -77,16 +79,16 @@ ${kadmin} -l \
     --realm-max-renewable-life=1month \
     ${R} || exit 1
 
-${kadmin} -l add -p foo --use-defaults foo/admin@${R} || exit 1
-${kadmin} -l add -p foo --use-defaults bar@${R} || exit 1
-${kadmin} -l add -p foo --use-defaults baz@${R} || exit 1
-${kadmin} -l add -p foo --use-defaults bez@${R} || exit 1
-${kadmin} -l add -p foo --use-defaults fez@${R} || exit 1
-${kadmin} -l add -p foo --use-defaults hasalias@${R} || exit 1
-${kadmin} -l add -p foo --use-defaults pkinit@${R} || exit 1
+${kadmin} -l add -p $foopassword --use-defaults foo/admin@${R} || exit 1
+${kadmin} -l add -p $foopassword --use-defaults bar@${R} || exit 1
+${kadmin} -l add -p $foopassword --use-defaults baz@${R} || exit 1
+${kadmin} -l add -p $foopassword --use-defaults bez@${R} || exit 1
+${kadmin} -l add -p $foopassword --use-defaults fez@${R} || exit 1
+${kadmin} -l add -p $foopassword --use-defaults hasalias@${R} || exit 1
+${kadmin} -l add -p $foopassword --use-defaults pkinit@${R} || exit 1
 ${kadmin} -l modify --pkinit-acl="CN=baz,DC=test,DC=h5l,DC=se" pkinit@${R} || exit 1
 
-echo foo > ${objdir}/foopassword
+echo $foopassword > ${objdir}/foopassword
 
 echo Starting kdc ; > messages.log
 ${kdc} --detach --testing || { echo "kdc failed to start"; exit 1; }
@@ -156,7 +158,7 @@ ${kinit} --password-file=${objdir}/foopassword \
     -S kadmin/admin@${R} bar@${R} || exit 1
 echo "kadmin"
 env KRB5CCNAME=${cache} \
-${kadmin} -p bar@${R} add -p foo --use-defaults kaka2@${R} || 
+${kadmin} -p bar@${R} add -p $foopassword --use-defaults kaka2@${R} || 
        { echo "kadmin failed $?"; cat messages.log ; exit 1; }
 
 ${kadmin} -l get kaka2@${R} > /dev/null ||
@@ -185,7 +187,7 @@ ${kinit} --password-file=${objdir}/foopassword \
     -S kadmin/admin@${R} baz@${R} || exit 1
 echo "kadmin globacl, negative"
 env KRB5CCNAME=${cache} \
-${kadmin} -p baz@${R} passwd -p foo bar@${R} > /dev/null 2>/dev/null && 
+${kadmin} -p baz@${R} passwd -p $foopassword bar@${R} > /dev/null 2>/dev/null && 
        { echo "kadmin succesded $?"; cat messages.log ; exit 1; }
 
 #----------------------------------
@@ -211,7 +213,7 @@ ${kinit} --password-file=${objdir}/foopassword \
     -S kadmin/admin@${R} bez@${R} || exit 1
 echo "kadmin globacl, negative"
 env KRB5CCNAME=${cache} \
-${kadmin} -p bez@${R} passwd -p foo bar@${R} > /dev/null 2>/dev/null && 
+${kadmin} -p bez@${R} passwd -p $foopassword bar@${R} > /dev/null 2>/dev/null && 
        { echo "kadmin succesded $?"; cat messages.log ; exit 1; }
 
 #----------------------------------
@@ -237,7 +239,7 @@ ${kinit} --password-file=${objdir}/foopassword \
     -S kadmin/admin@${R} fez@${R} || exit 1
 echo "kadmin globacl, negative"
 env KRB5CCNAME=${cache} \
-${kadmin} -p fez@${R} passwd -p foo bar@${R} > /dev/null 2>/dev/null && 
+${kadmin} -p fez@${R} passwd -p $foopassword bar@${R} > /dev/null 2>/dev/null && 
        { echo "kadmin succesded $?"; cat messages.log ; exit 1; }
 
 #----------------------------------
@@ -251,7 +253,7 @@ ${kinit} --password-file=${objdir}/foopassword \
 
 echo "kadmin"
 env KRB5CCNAME=${cache} \
-${kadmin} -p foo/admin@${R} add -p foo --use-defaults kaka@${R} || 
+${kadmin} -p foo/admin@${R} add -p $foopassword --use-defaults kaka@${R} || 
        { echo "kadmin failed $?"; cat messages.log ; exit 1; }
 
 #----------------------------------