kadmin: Fix re-entrance in iterations

Any callback of kadm5_iter_principals() that wants to call other kadm5
functions (such as kadm5_get_principal()) needs to do so on a different
kadm5 handle than the one used for kadm5_iter_principals().
This commit is contained in:
Nicolas Williams
2022-03-23 17:00:11 -05:00
parent c667c28f61
commit 621deed047
6 changed files with 109 additions and 51 deletions

View File

@@ -318,6 +318,17 @@ env KRB5CCNAME=${cache} \
[ `wc -l < kadmin.tmp` -eq 3 ] ||
{ echo "kadmin list --upto 3 produced `wc -l < kadmin.tmp` results!"; exit 1; }
#----------------------------------
echo "kadmin get '*' (re-entrance)"; > messages.log
${kadmin} -l get '*' > kadmin.tmp ||
{ echo "failed to list principals"; cat messages.log ; exit 1; }
> messages.log
env KRB5CCNAME=${cache} \
${kadmin} -p foo/admin@${R} get '*' > kadmin.tmp2 ||
{ echo "failed to list principals"; cat messages.log ; exit 1; }
diff -u kadmin.tmp kadmin.tmp2 ||
{ echo "local and remote get all differ"; exit 1; }
#----------------------------------
# We have 20 principals in the DB. Test two chunks of 1 (since that's how we
# started kadmind above.