From: Greg Hudson Date: Fri, 2 Jul 2010 19:18:12 +0000 (+0000) Subject: Make krb5_db_free_principal and krb5_db_free_mkey_list return void. X-Git-Tag: krb5-1.9-beta1~164 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f6e3bd28d32e584b6b4bcfe63a48466c97428b59;p=krb5.git Make krb5_db_free_principal and krb5_db_free_mkey_list return void. Remove the stale prototype for krb5_db_free_master_key. ticket: 6749 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24167 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/include/kdb.h b/src/include/kdb.h index 856cf0bdf..b959b1572 100644 --- a/src/include/kdb.h +++ b/src/include/kdb.h @@ -434,9 +434,8 @@ krb5_error_code krb5_db_get_principal_ext ( krb5_context kcontext, krb5_db_entry *entries, int *nentries, krb5_boolean *more ); -krb5_error_code krb5_db_free_principal ( krb5_context kcontext, - krb5_db_entry *entry, - int count ); +void krb5_db_free_principal ( krb5_context kcontext, krb5_db_entry *entry, + int count ); krb5_error_code krb5_db_put_principal ( krb5_context kcontext, krb5_db_entry *entries, int *nentries); @@ -454,8 +453,6 @@ krb5_error_code krb5_db_set_mkey_list( krb5_context context, krb5_error_code krb5_db_get_mkey_list( krb5_context kcontext, krb5_keylist_node ** keylist); -krb5_error_code krb5_db_free_master_key ( krb5_context kcontext, - krb5_keyblock *key ); krb5_error_code krb5_db_store_master_key ( krb5_context kcontext, char *keyfile, krb5_principal mname, @@ -483,7 +480,7 @@ krb5_db_fetch_mkey_list( krb5_context context, krb5_kvno mkvno, krb5_keylist_node **mkeys_list ); -krb5_error_code +void krb5_db_free_mkey_list( krb5_context context, krb5_keylist_node *mkey_list ); @@ -1011,8 +1008,8 @@ typedef struct _kdb_vftabl { * allocate associated memory); thus, a plugin must allocate each field * of a principal entry separately. */ - krb5_error_code (*free_principal)(krb5_context kcontext, - krb5_db_entry *entry, int count); + void (*free_principal)(krb5_context kcontext, krb5_db_entry *entry, + int count); /* * Optional: Create or modify one or more principal entries. All callers diff --git a/src/lib/kdb/kdb5.c b/src/lib/kdb/kdb5.c index 8a1998457..b06cf76c5 100644 --- a/src/lib/kdb/kdb5.c +++ b/src/lib/kdb/kdb5.c @@ -776,7 +776,7 @@ krb5_db_get_principal_ext(krb5_context kcontext, more); } -krb5_error_code +void krb5_db_free_principal(krb5_context kcontext, krb5_db_entry * entry, int count) { krb5_error_code status = 0; @@ -784,10 +784,8 @@ krb5_db_free_principal(krb5_context kcontext, krb5_db_entry * entry, int count) status = get_vftabl(kcontext, &v); if (status) - return status; - if (v->free_principal == NULL) - return KRB5_KDB_DBTYPE_NOSUP; - return v->free_principal(kcontext, entry, count); + return; + v->free_principal(kcontext, entry, count); } static void @@ -1113,7 +1111,7 @@ krb5_db_fetch_mkey_list(krb5_context context, return v->fetch_master_key_list(context, mname, mkey, mkvno, mkey_list); } -krb5_error_code +void krb5_db_free_mkey_list(krb5_context context, krb5_keylist_node *mkey_list) { @@ -1125,8 +1123,6 @@ krb5_db_free_mkey_list(krb5_context context, krb5_free_keyblock_contents(context, &prev->keyblock); krb5_xfree(prev); } - - return 0; } krb5_error_code diff --git a/src/plugins/kdb/db2/db2_exp.c b/src/plugins/kdb/db2/db2_exp.c index aabeb9d03..f6132e98d 100644 --- a/src/plugins/kdb/db2/db2_exp.c +++ b/src/plugins/kdb/db2/db2_exp.c @@ -125,11 +125,11 @@ WRAP_K (krb5_db2_get_principal, int * i, krb5_boolean *b), (ctx, p, d, i, b)); -WRAP_K (krb5_db2_free_principal, - (krb5_context ctx, - krb5_db_entry *d, - int i), - (ctx, d, i)); +WRAP_VOID (krb5_db2_free_principal, + (krb5_context ctx, + krb5_db_entry *d, + int i), + (ctx, d, i)); WRAP_K (krb5_db2_put_principal, (krb5_context ctx, krb5_db_entry *d, diff --git a/src/plugins/kdb/db2/kdb_db2.c b/src/plugins/kdb/db2/kdb_db2.c index 3e32a9437..22a913352 100644 --- a/src/plugins/kdb/db2/kdb_db2.c +++ b/src/plugins/kdb/db2/kdb_db2.c @@ -925,7 +925,7 @@ cleanup: /* Free stuff returned by krb5_db2_get_principal. */ -krb5_error_code +void krb5_db2_free_principal(krb5_context context, krb5_db_entry *entries, int nentries) { diff --git a/src/plugins/kdb/db2/kdb_db2.h b/src/plugins/kdb/db2/kdb_db2.h index f31017d10..d7ac7a4cb 100644 --- a/src/plugins/kdb/db2/kdb_db2.h +++ b/src/plugins/kdb/db2/kdb_db2.h @@ -61,7 +61,7 @@ krb5_error_code krb5_db2_get_age(krb5_context, char *, time_t *); krb5_error_code krb5_db2_rename(krb5_context, char *, char *, int ); krb5_error_code krb5_db2_get_principal(krb5_context, krb5_const_principal, krb5_db_entry *, int *, krb5_boolean *); -krb5_error_code krb5_db2_free_principal(krb5_context, krb5_db_entry *, int); +void krb5_db2_free_principal(krb5_context, krb5_db_entry *, int); krb5_error_code krb5_db2_put_principal(krb5_context, krb5_db_entry *, int *, char **db_args); krb5_error_code krb5_db2_iterate_ext(krb5_context, diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal.c b/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal.c index 5fcc92b68..9128fd5d7 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal.c +++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal.c @@ -122,7 +122,7 @@ krb5_dbe_free_contents(krb5_context context, krb5_db_entry *entry) } -krb5_error_code +void krb5_ldap_free_principal(krb5_context kcontext, krb5_db_entry *entries, int nentries) { diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal.h b/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal.h index 9969d532a..805462d36 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal.h +++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal.h @@ -104,7 +104,7 @@ krb5_ldap_get_principal(krb5_context , krb5_const_principal , krb5_error_code krb5_ldap_delete_principal(krb5_context, krb5_const_principal, int *); -krb5_error_code +void krb5_ldap_free_principal(krb5_context, krb5_db_entry *, int ); krb5_error_code