summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/hdb/db.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-12-15 20:38:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:47:26 -0500
commitfbf106f6701c580f5839da575996de34fc953e1f (patch)
tree3691623409aab4ff0ede4b50cc4fcbfa255814f3 /source4/heimdal/lib/hdb/db.c
parentd8966dcd7e88df9817c81434056628c0beff21e3 (diff)
downloadsamba-fbf106f6701c580f5839da575996de34fc953e1f.tar.gz
samba-fbf106f6701c580f5839da575996de34fc953e1f.tar.bz2
samba-fbf106f6701c580f5839da575996de34fc953e1f.zip
r12269: Update to current lorikeet-heimdal. This changed the way the hdb
interface worked, so hdb-ldb.c and the glue have been updated. Andrew Bartlett (This used to be commit 8fd5224c6b5c17c3a2c04c7366b7e367012db77e)
Diffstat (limited to 'source4/heimdal/lib/hdb/db.c')
-rw-r--r--source4/heimdal/lib/hdb/db.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/source4/heimdal/lib/hdb/db.c b/source4/heimdal/lib/hdb/db.c
index 4cc0218a5c..4b4e6e673d 100644
--- a/source4/heimdal/lib/hdb/db.c
+++ b/source4/heimdal/lib/hdb/db.c
@@ -33,7 +33,7 @@
#include "hdb_locl.h"
-RCSID("$Id: db.c,v 1.33 2005/11/28 23:30:51 lha Exp $");
+RCSID("$Id: db.c,v 1.35 2005/12/13 11:52:55 lha Exp $");
#if HAVE_DB1
@@ -85,7 +85,7 @@ DB_unlock(krb5_context context, HDB *db)
static krb5_error_code
DB_seq(krb5_context context, HDB *db,
- unsigned flags, hdb_entry *entry, int flag)
+ unsigned flags, hdb_entry_ex *entry, int flag)
{
DB *d = (DB*)db->hdb_db;
DBT key, value;
@@ -106,21 +106,22 @@ DB_seq(krb5_context context, HDB *db,
key_data.length = key.size;
data.data = value.data;
data.length = value.size;
- if (hdb_value2entry(context, &data, entry))
+ memset(entry, 0, sizeof(*entry));
+ if (hdb_value2entry(context, &data, &entry->entry))
return DB_seq(context, db, flags, entry, R_NEXT);
if (db->hdb_master_key_set && (flags & HDB_F_DECRYPT)) {
- code = hdb_unseal_keys (context, db, entry);
+ code = hdb_unseal_keys (context, db, &entry->entry);
if (code)
hdb_free_entry (context, entry);
}
- if (code == 0 && entry->principal == NULL) {
- entry->principal = malloc(sizeof(*entry->principal));
- if (entry->principal == NULL) {
+ if (code == 0 && entry->entry.principal == NULL) {
+ entry->entry.principal = malloc(sizeof(*entry->entry.principal));
+ if (entry->entry.principal == NULL) {
krb5_set_error_string(context, "malloc: out of memory");
code = ENOMEM;
hdb_free_entry (context, entry);
} else {
- hdb_key2principal(context, &key_data, entry->principal);
+ hdb_key2principal(context, &key_data, entry->entry.principal);
}
}
return code;
@@ -128,14 +129,14 @@ DB_seq(krb5_context context, HDB *db,
static krb5_error_code
-DB_firstkey(krb5_context context, HDB *db, unsigned flags, hdb_entry *entry)
+DB_firstkey(krb5_context context, HDB *db, unsigned flags, hdb_entry_ex *entry)
{
return DB_seq(context, db, flags, entry, R_FIRST);
}
static krb5_error_code
-DB_nextkey(krb5_context context, HDB *db, unsigned flags, hdb_entry *entry)
+DB_nextkey(krb5_context context, HDB *db, unsigned flags, hdb_entry_ex *entry)
{
return DB_seq(context, db, flags, entry, R_NEXT);
}