Remove adb_policy_init and adb_policy_close
authorTomas Kuthan <tkuthan@gmail.com>
Thu, 3 Apr 2014 15:58:43 +0000 (17:58 +0200)
committerGreg Hudson <ghudson@mit.edu>
Fri, 4 Apr 2014 18:02:47 +0000 (14:02 -0400)
Since f72c3ffa the policy is initialized as part of database.
adb_policy_close is now a no-op, and adb_policy_init just makes sure
the database is initialized.  adb_policy_init is only called from
kadm5_flush, and only if database initialization was successful
beforehand, rendering this call redundant.

Remove adb_policy_init and adb_policy_close and all their references
in the code and documentation.

doc/kadm5/api-funcspec.tex
src/lib/kadm5/server_internal.h
src/lib/kadm5/srv/libkadm5srv_mit.exports
src/lib/kadm5/srv/server_init.c
src/lib/kadm5/srv/server_misc.c

index bf885b464fb44e766f900ed70c7c09a7fe5b636a..c13090a519e341fc969813f66d0f5f42a1bebbb4 100644 (file)
@@ -1107,9 +1107,8 @@ the Admin API open.  This function behaves differently when called by
 local and remote clients.
 
 For local clients, the function closes and reopens the Kerberos
-database with krb5_db_fini() and krb5_db_init(), and closes and
-reopens the Admin policy database with adb_policy_close() and
-adb_policy_open().  Although it is unlikely, any other these functions
+database with krb5_db_fini() and krb5_db_init().
+Although it is unlikely, either of these functions
 could return errors; in that case, this function calls
 kadm5_destroy and returns the error code.  Therefore, if
 kadm5_flush does not return KADM5_OK, the connection to the
index e506e12ea7f17acf0f2265eae734ccd085db2c99..623187dd56559f1d929ffda3c13d94ebfd1fa741 100644 (file)
@@ -70,8 +70,6 @@ typedef struct _osa_princ_ent_t {
 } osa_princ_ent_rec, *osa_princ_ent_t;
 
 
-kadm5_ret_t    adb_policy_init(kadm5_server_handle_t handle);
-kadm5_ret_t    adb_policy_close(kadm5_server_handle_t handle);
 kadm5_ret_t    passwd_check(kadm5_server_handle_t handle,
                             const char *pass, kadm5_policy_ent_t policy,
                             krb5_principal principal);
index 07d447a1527370ee1a9670a72057b47bdd8bded7..8602e76587d897c2739242d8032299cd3bd19f38 100644 (file)
@@ -5,8 +5,6 @@ kadm5int_acl_check_krb
 kadm5int_acl_finish
 kadm5int_acl_impose_restrictions
 kadm5int_acl_init
-adb_policy_close
-adb_policy_init
 hist_princ
 kadm5_set_use_password_server
 kadm5_chpass_principal
index 5e61f2854c5897f4a1055d50dd11ee4ce737a67c..f46f89d9881cfdaa760d2e2674b26995da902a66 100644 (file)
@@ -346,7 +346,6 @@ kadm5_ret_t kadm5_destroy(void *server_handle)
     destroy_pwqual(handle);
 
     k5_kadm5_hook_free_handles(handle->context, handle->hook_handles);
-    adb_policy_close(handle);
     krb5_db_fini(handle->context);
     krb5_free_principal(handle->context, handle->current_caller);
     kadm5_free_config_params(handle->context, &handle->params);
@@ -393,9 +392,7 @@ kadm5_ret_t kadm5_flush(void *server_handle)
 
     if ((ret = krb5_db_fini(handle->context)) ||
         (ret = krb5_db_open(handle->context, handle->db_args,
-                            KRB5_KDB_OPEN_RW | KRB5_KDB_SRV_TYPE_ADMIN)) ||
-        (ret = adb_policy_close(handle)) ||
-        (ret = adb_policy_init(handle))) {
+                            KRB5_KDB_OPEN_RW | KRB5_KDB_SRV_TYPE_ADMIN))) {
         (void) kadm5_destroy(server_handle);
         return ret;
     }
index 18d047b995ed3da8b178b67667a8448d5df383e9..b361847bd5533bfb2dde81e1acffb7235274739c 100644 (file)
 #include    "server_internal.h"
 #include    <adm_proto.h>
 
-kadm5_ret_t
-adb_policy_init(kadm5_server_handle_t handle)
-{
-    /* now policy is initialized as part of database. No seperate call needed */
-    if (krb5_db_inited(handle->context) == 0)
-        return KADM5_OK;
-
-    return krb5_db_open( handle->context, NULL,
-                         KRB5_KDB_OPEN_RW | KRB5_KDB_SRV_TYPE_ADMIN );
-}
-
-kadm5_ret_t
-adb_policy_close(kadm5_server_handle_t handle)
-{
-    /* will be taken care by database close */
-    return KADM5_OK;
-}
-
 kadm5_ret_t
 init_pwqual(kadm5_server_handle_t handle)
 {