add flags to DB_seq, DB_firstkey, and DB_nextkey

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6089 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1999-05-03 16:51:51 +00:00
parent a63a5c88f7
commit f604b5db10

View File

@@ -83,7 +83,8 @@ DB_unlock(krb5_context context, HDB *db)
static krb5_error_code static krb5_error_code
DB_seq(krb5_context context, HDB *db, hdb_entry *entry, int flag) DB_seq(krb5_context context, HDB *db,
unsigned flags, hdb_entry *entry, int flag)
{ {
DB *d = (DB*)db->db; DB *d = (DB*)db->db;
DBT key, value; DBT key, value;
@@ -105,9 +106,9 @@ DB_seq(krb5_context context, HDB *db, hdb_entry *entry, int flag)
data.data = value.data; data.data = value.data;
data.length = value.size; data.length = value.size;
if (hdb_value2entry(context, &data, entry)) if (hdb_value2entry(context, &data, entry))
return DB_seq(context, db, entry, R_NEXT); return DB_seq(context, db, flags, entry, R_NEXT);
if (db->master_key_set) if (db->master_key_set && (flags & HDB_F_DECRYPT))
hdb_unseal_keys (entry, db->master_key); hdb_unseal_keys (db, entry);
if (entry->principal == NULL) { if (entry->principal == NULL) {
entry->principal = malloc(sizeof(*entry->principal)); entry->principal = malloc(sizeof(*entry->principal));
hdb_key2principal(context, &key_data, entry->principal); hdb_key2principal(context, &key_data, entry->principal);
@@ -117,16 +118,16 @@ DB_seq(krb5_context context, HDB *db, hdb_entry *entry, int flag)
static krb5_error_code static krb5_error_code
DB_firstkey(krb5_context context, HDB *db, hdb_entry *entry) DB_firstkey(krb5_context context, HDB *db, unsigned flags, hdb_entry *entry)
{ {
return DB_seq(context, db, entry, R_FIRST); return DB_seq(context, db, flags, entry, R_FIRST);
} }
static krb5_error_code static krb5_error_code
DB_nextkey(krb5_context context, HDB *db, hdb_entry *entry) DB_nextkey(krb5_context context, HDB *db, unsigned flags, hdb_entry *entry)
{ {
return DB_seq(context, db, entry, R_NEXT); return DB_seq(context, db, flags, entry, R_NEXT);
} }
static krb5_error_code static krb5_error_code