(_kdc_db_fetch): set error string for failures.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21106 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2007-06-18 10:18:11 +00:00
parent 3b9777f5ac
commit 30a0cc5d6a

View File

@@ -46,12 +46,14 @@ _kdc_db_fetch(krb5_context context,
hdb_entry_ex **h) hdb_entry_ex **h)
{ {
hdb_entry_ex *ent; hdb_entry_ex *ent;
krb5_error_code ret = HDB_ERR_NOENTRY; krb5_error_code ret;
int i; int i;
ent = calloc (1, sizeof (*ent)); ent = calloc (1, sizeof (*ent));
if (ent == NULL) if (ent == NULL) {
krb5_set_error_string(context, "out of memory");
return ENOMEM; return ENOMEM;
}
for(i = 0; i < config->num_db; i++) { for(i = 0; i < config->num_db; i++) {
ret = config->db[i]->hdb_open(context, config->db[i], O_RDONLY, 0); ret = config->db[i]->hdb_open(context, config->db[i], O_RDONLY, 0);
@@ -74,7 +76,8 @@ _kdc_db_fetch(krb5_context context,
} }
} }
free(ent); free(ent);
return ret; krb5_set_error_string(context, "no such entry found in hdb");
return HDB_ERR_NOENTRY;
} }
void void