From ffa7f66531001df13a61002c4506457dc0588ae8 Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Sat, 21 Mar 1998 01:59:07 +0000 Subject: [PATCH] If kadm5_get_principals failes, we might still be able to perform the requested opreration (for instance someone if trying to change his own password). git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4629 ec53bebd-3082-4978-b11e-865c3cabbd6b --- kadmin/util.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kadmin/util.c b/kadmin/util.c index 813206cfb..665daf7d2 100644 --- a/kadmin/util.c +++ b/kadmin/util.c @@ -215,6 +215,14 @@ foreach_principal(const char *exp, krb5_error_code ret; krb5_principal princ_ent; ret = kadm5_get_principals(kadm_handle, exp, &princs, &num_princs); + if(ret == KADM5_AUTH_LIST) { + /* we might be able to perform the requested opreration even + if we're not allowed to list principals */ + num_princs = 1; + princs = malloc(sizeof(*princs)); + princs[0] = strdup(exp); + ret = 0; + } if(ret) return ret; for(i = 0; i < num_princs; i++) {