provide better error string for the common failure case.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21113 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -268,6 +268,7 @@ hdb_entry_get_password(krb5_context context, HDB *db,
|
|||||||
const hdb_entry *entry, char **p)
|
const hdb_entry *entry, char **p)
|
||||||
{
|
{
|
||||||
HDB_extension *ext;
|
HDB_extension *ext;
|
||||||
|
char *str;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ext = hdb_find_extension(entry, choice_HDB_extension_data_password);
|
ext = hdb_find_extension(entry, choice_HDB_extension_data_password);
|
||||||
@@ -314,7 +315,14 @@ hdb_entry_get_password(krb5_context context, HDB *db,
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
krb5_set_error_string(context, "password attribute not found");
|
|
||||||
|
ret = krb5_unparse_name(context, entry->principal, &str);
|
||||||
|
if (ret == 0) {
|
||||||
|
krb5_set_error_string(context, "no password attributefor %s", str);
|
||||||
|
free(str);
|
||||||
|
} else
|
||||||
|
krb5_clear_error_string(context);
|
||||||
|
|
||||||
return ENOENT;
|
return ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user