(db_fetch): return an error code. change callers to look at this and

try to print it in log messages


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9598 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
2001-01-30 01:43:07 +00:00
parent fa7eecfdae
commit 03056efa09

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997 - 2000 Kungliga Tekniska H<>gskolan * Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden). * (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved. * All rights reserved.
* *
@@ -37,8 +37,8 @@ RCSID("$Id$");
struct timeval now; struct timeval now;
hdb_entry* krb5_error_code
db_fetch(krb5_principal principal) db_fetch(krb5_principal principal, hdb_entry **h)
{ {
hdb_entry *ent; hdb_entry *ent;
krb5_error_code ret; krb5_error_code ret;
@@ -46,7 +46,7 @@ db_fetch(krb5_principal principal)
ent = malloc (sizeof (*ent)); ent = malloc (sizeof (*ent));
if (ent == NULL) if (ent == NULL)
return NULL; return ENOMEM;
ent->principal = principal; ent->principal = principal;
for(i = 0; i < num_db; i++) { for(i = 0; i < num_db; i++) {
@@ -58,11 +58,13 @@ db_fetch(krb5_principal principal)
} }
ret = db[i]->fetch(context, db[i], HDB_F_DECRYPT, ent); ret = db[i]->fetch(context, db[i], HDB_F_DECRYPT, ent);
db[i]->close(context, db[i]); db[i]->close(context, db[i]);
if(ret == 0) if(ret == 0) {
return ent; *h = ent;
return 0;
}
} }
free(ent); free(ent);
return NULL; return ENOENT;
} }
void void