Pass in HDB_F_GET_ANY to all ->hdb fetch to hint what entries we are looking for

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17313 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-04-27 11:18:52 +00:00
parent 06660d5790
commit eea5f34855
7 changed files with 16 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997-2005 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997-2006 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -53,7 +53,7 @@ change(void *server_handle,
if(ret)
return ret;
ret = context->db->hdb_fetch(context->context, context->db, princ,
HDB_F_DECRYPT, &ent);
HDB_F_DECRYPT|HDB_F_GET_ANY, &ent);
if(ret == HDB_ERR_NOENTRY)
goto out;
@@ -151,7 +151,8 @@ kadm5_s_chpass_principal_with_key(void *server_handle,
ret = context->db->hdb_open(context->context, context->db, O_RDWR, 0);
if(ret)
return ret;
ret = context->db->hdb_fetch(context->context, context->db, princ, 0, &ent);
ret = context->db->hdb_fetch(context->context, context->db, princ,
HDB_F_GET_ANY, &ent);
if(ret == HDB_ERR_NOENTRY)
goto out;
ret = _kadm5_set_keys2(context, &ent.entry, n_key_data, key_data);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2001, 2003, 2005 - 2006 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -49,7 +49,7 @@ kadm5_s_delete_principal(void *server_handle, krb5_principal princ)
return ret;
}
ret = context->db->hdb_fetch(context->context, context->db, princ,
HDB_F_DECRYPT, &ent);
HDB_F_DECRYPT|HDB_F_GET_ANY, &ent);
if(ret == HDB_ERR_NOENTRY)
goto out2;
if(ent.entry.flags.immutable) {

View File

@@ -79,7 +79,7 @@ kadm5_s_get_principal(void *server_handle,
if(ret)
return ret;
ret = context->db->hdb_fetch(context->context, context->db, princ,
HDB_F_DECRYPT, &ent);
HDB_F_DECRYPT|HDB_F_GET_ANY, &ent);
context->db->hdb_close(context->context, context->db);
if(ret)
return _kadm5_error_code(ret);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2005 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2006 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -554,7 +554,7 @@ kadm5_log_replay_modify (kadm5_server_context *context,
memset(&ent, 0, sizeof(ent));
ret = context->db->hdb_fetch(context->context, context->db,
log_ent.entry.principal,
HDB_F_DECRYPT, &ent);
HDB_F_DECRYPT|HDB_F_GET_ANY, &ent);
if (ret)
goto out;
if (mask & KADM5_PRINC_EXPIRE_TIME) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997-2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997-2001, 2003, 2005-2006 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -54,7 +54,7 @@ modify_principal(void *server_handle,
if(ret)
return ret;
ret = context->db->hdb_fetch(context->context, context->db,
princ->principal, 0, &ent);
princ->principal, HDB_F_GET_ANY, &ent);
if(ret)
goto out;
ret = _kadm5_setup_entry(context, &ent, mask, princ, mask, NULL, 0);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997-2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997-2001, 2003-2006 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -54,7 +54,8 @@ kadm5_s_randkey_principal(void *server_handle,
ret = context->db->hdb_open(context->context, context->db, O_RDWR, 0);
if(ret)
return ret;
ret = context->db->hdb_fetch(context->context, context->db, princ, 0, &ent);
ret = context->db->hdb_fetch(context->context, context->db, princ,
HDB_F_GET_ANY, &ent);
if(ret)
goto out;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2001, 2003, 2005 - 2005 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -52,7 +52,7 @@ kadm5_s_rename_principal(void *server_handle,
if(ret)
return ret;
ret = context->db->hdb_fetch(context->context, context->db,
source, 0, &ent);
source, HDB_F_GET_ANY, &ent);
if(ret){
context->db->hdb_close(context->context, context->db);
goto out;