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
This commit is contained in:
@@ -215,6 +215,14 @@ foreach_principal(const char *exp,
|
|||||||
krb5_error_code ret;
|
krb5_error_code ret;
|
||||||
krb5_principal princ_ent;
|
krb5_principal princ_ent;
|
||||||
ret = kadm5_get_principals(kadm_handle, exp, &princs, &num_princs);
|
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)
|
if(ret)
|
||||||
return ret;
|
return ret;
|
||||||
for(i = 0; i < num_princs; i++) {
|
for(i = 0; i < num_princs; i++) {
|
||||||
|
Reference in New Issue
Block a user