(_kdc_db_fetch): set error string for failures.
authorLove Hörnquist Åstrand <lha@kth.se>
Mon, 18 Jun 2007 10:18:11 +0000 (10:18 +0000)
committerLove Hörnquist Åstrand <lha@kth.se>
Mon, 18 Jun 2007 10:18:11 +0000 (10:18 +0000)
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21106 ec53bebd-3082-4978-b11e-865c3cabbd6b

kdc/misc.c

index e4ba8e05a4d282073dc4192147ff1aa45c13f267..60d7dc286c06391d45ba1967c585e5231737e6fa 100644 (file)
@@ -46,12 +46,14 @@ _kdc_db_fetch(krb5_context context,
              hdb_entry_ex **h)
 {
     hdb_entry_ex *ent;
-    krb5_error_code ret = HDB_ERR_NOENTRY;
+    krb5_error_code ret;
     int i;
 
     ent = calloc (1, sizeof (*ent));
-    if (ent == NULL)
+    if (ent == NULL) {
+       krb5_set_error_string(context, "out of memory");
        return ENOMEM;
+    }
 
     for(i = 0; i < config->num_db; i++) {
        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);
-    return ret;
+    krb5_set_error_string(context, "no such entry found in hdb");
+    return  HDB_ERR_NOENTRY;
 }
 
 void