principal can't specify ks_tuples changing own passwd
authorTom Yu <tlyu@mit.edu>
Tue, 8 Oct 2002 20:53:29 +0000 (20:53 +0000)
committerTom Yu <tlyu@mit.edu>
Tue, 8 Oct 2002 20:53:29 +0000 (20:53 +0000)
Thanks, the patch has been applied and will appear in a future release.

* misc.c (chpass_principal_wrapper_3): Renamed from
chpass_principal_wrapper; calls chpass_principal_3 now.
(randkey_principal_wrapper_3): Renamed from
randkey_principal_wrapper; calls randkey_principal_3 now.  Patch
from Ben Cox.

* server_stubs.c (chpass_principal_1_svc)
(chpass_principal3_1_svc): Call chpass_principal_wrapper_3.
(chrand_principal_1_svc, chrand_principal3_1_svc): Call
randkey_principal_wrapper_3.  Patch from Ben Cox.

ticket: 1207
version_reported: 1.2.6
target_version: 1.3

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14915 dc483132-0cff-0310-8789-dd5450dbe970

src/kadmin/server/ChangeLog
src/kadmin/server/misc.c
src/kadmin/server/server_stubs.c

index 7297d89ed5eacdeb4ac73b5b2e79ac982babf848..55bc680dea2062e41859cd2bfab2b7ae44caa1ce 100644 (file)
@@ -1,3 +1,16 @@
+2002-10-08  Tom Yu  <tlyu@mit.edu>
+
+       * misc.c (chpass_principal_wrapper_3): Renamed from
+       chpass_principal_wrapper; calls chpass_principal_3 now.
+       (randkey_principal_wrapper_3): Renamed from
+       randkey_principal_wrapper; calls randkey_principal_3 now.  Patch
+       from Ben Cox.
+
+       * server_stubs.c (chpass_principal_1_svc)
+       (chpass_principal3_1_svc): Call chpass_principal_wrapper_3.
+       (chrand_principal_1_svc, chrand_principal3_1_svc): Call
+       randkey_principal_wrapper_3.  Patch from Ben Cox.
+
 2002-08-29  Ken Raeburn  <raeburn@mit.edu>
 
        * Makefile.in: Revert $(S)=>/ change, for Windows support.
index 9a9c7668a1019867519c11f6ceced67323ccc6c3..f4c7317d9efe6e4b71eb168b3a6c17104c2dd7d8 100644 (file)
@@ -9,7 +9,7 @@
 #include    "misc.h"
 
 /*
- * Function: chpass_principal_wrapper
+ * Function: chpass_principal_wrapper_3
  * 
  * Purpose: wrapper to kadm5_chpass_principal that checks to see if
  *         pw_min_life has been reached. if not it returns an error.
  * Arguments:
  *     principal       (input) krb5_principals whose password we are
  *                             changing
- *     passoword       (input) password we are going to change to.
+ *     keepold         (input) whether to preserve old keys
+ *     n_ks_tuple      (input) the number of key-salt tuples in ks_tuple
+ *     ks_tuple        (input) array of tuples indicating the caller's
+ *                             requested enctypes/salttypes
+ *     password        (input) password we are going to change to.
  *     <return value>  0 on success error code on failure.
  *
  * Requires:
  *
  */
 kadm5_ret_t
-chpass_principal_wrapper(void *server_handle,
-                        krb5_principal principal, char *password)
+chpass_principal_wrapper_3(void *server_handle,
+                          krb5_principal principal,
+                          krb5_boolean keepold,
+                          int n_ks_tuple,
+                          krb5_key_salt_tuple *ks_tuple,
+                          char *password)
 {
     krb5_int32                 now;
     kadm5_ret_t                        ret;
@@ -71,12 +79,14 @@ chpass_principal_wrapper(void *server_handle,
     if (ret)
         return ret;
     
-    return kadm5_chpass_principal(server_handle, principal, password);
+    return kadm5_chpass_principal_3(server_handle, principal,
+                                   keepold, n_ks_tuple, ks_tuple,
+                                   password);
 }
 
 
 /*
- * Function: randkey_principal_wrapper
+ * Function: randkey_principal_wrapper_3
  * 
  * Purpose: wrapper to kadm5_randkey_principal which checks the
            passwords min. life.
@@ -84,6 +94,10 @@ chpass_principal_wrapper(void *server_handle,
  * Arguments:
  *     principal           (input) krb5_principal whose password we are
  *                                 changing
+ *     keepold         (input) whether to preserve old keys
+ *     n_ks_tuple      (input) the number of key-salt tuples in ks_tuple
+ *     ks_tuple        (input) array of tuples indicating the caller's
+ *                             requested enctypes/salttypes
  *     key                 (output) new random key
  *     <return value>      0, error code on error.
  *
@@ -95,9 +109,12 @@ chpass_principal_wrapper(void *server_handle,
  *
  */
 kadm5_ret_t
-randkey_principal_wrapper(void *server_handle,
-                         krb5_principal principal,
-                         krb5_keyblock **keys, int *n_keys)
+randkey_principal_wrapper_3(void *server_handle,
+                           krb5_principal principal,
+                           krb5_boolean keepold,
+                           int n_ks_tuple,
+                           krb5_key_salt_tuple *ks_tuple,
+                           krb5_keyblock **keys, int *n_keys)
 {
 
     krb5_int32                 now;
@@ -137,5 +154,7 @@ randkey_principal_wrapper(void *server_handle,
     ret = kadm5_free_principal_ent(handle->lhandle, &princ);
     if (ret)
         return ret;
-    return kadm5_randkey_principal(server_handle, principal, keys, n_keys);
+    return kadm5_randkey_principal_3(server_handle, principal,
+                                    keepold, n_ks_tuple, ks_tuple,
+                                    keys, n_keys);
 }
index a8bd5ce5225130c183b9b89b5e36e2eb3250f3ba..d087e0d3d739cfc7058e373a58a1161fcb774abf 100644 (file)
@@ -689,8 +689,8 @@ chpass_principal_1_svc(chpass_arg *arg, struct svc_req *rqstp)
     }
 
     if (cmp_gss_krb5_name(handle, rqstp->rq_clntcred, arg->princ)) {
-        ret.code = chpass_principal_wrapper((void *)handle, arg->princ,
-                                            arg->pass);
+        ret.code = chpass_principal_wrapper_3((void *)handle, arg->princ,
+                                              FALSE, 0, NULL, arg->pass);
     } else if (!(CHANGEPW_SERVICE(rqstp)) &&
               acl_check(handle->context, rqstp->rq_clntcred,
                         ACL_CHANGEPW, arg->princ, NULL)) {
@@ -750,8 +750,11 @@ chpass_principal3_1_svc(chpass3_arg *arg, struct svc_req *rqstp)
     }
 
     if (cmp_gss_krb5_name(handle, rqstp->rq_clntcred, arg->princ)) {
-        ret.code = chpass_principal_wrapper((void *)handle, arg->princ,
-                                            arg->pass);
+        ret.code = chpass_principal_wrapper_3((void *)handle, arg->princ,
+                                              arg->keepold,
+                                              arg->n_ks_tuple,
+                                              arg->ks_tuple,
+                                              arg->pass);
     } else if (!(CHANGEPW_SERVICE(rqstp)) &&
               acl_check(handle->context, rqstp->rq_clntcred,
                         ACL_CHANGEPW, arg->princ, NULL)) {
@@ -997,8 +1000,8 @@ chrand_principal_1_svc(chrand_arg *arg, struct svc_req *rqstp)
     }
 
     if (cmp_gss_krb5_name(handle, rqstp->rq_clntcred, arg->princ)) {
-        ret.code = randkey_principal_wrapper((void *)handle,
-                                             arg->princ, &k, &nkeys); 
+        ret.code = randkey_principal_wrapper_3((void *)handle, arg->princ,
+                                               FALSE, 0, NULL, &k, &nkeys);
     } else if (!(CHANGEPW_SERVICE(rqstp)) &&
               acl_check(handle->context, rqstp->rq_clntcred,
                         ACL_CHANGEPW, arg->princ, NULL)) {
@@ -1073,8 +1076,11 @@ chrand_principal3_1_svc(chrand3_arg *arg, struct svc_req *rqstp)
     }
 
     if (cmp_gss_krb5_name(handle, rqstp->rq_clntcred, arg->princ)) {
-        ret.code = randkey_principal_wrapper((void *)handle,
-                                             arg->princ, &k, &nkeys); 
+        ret.code = randkey_principal_wrapper_3((void *)handle, arg->princ,
+                                               arg->keepold,
+                                               arg->n_ks_tuple,
+                                               arg->ks_tuple,
+                                               &k, &nkeys);
     } else if (!(CHANGEPW_SERVICE(rqstp)) &&
               acl_check(handle->context, rqstp->rq_clntcred,
                         ACL_CHANGEPW, arg->princ, NULL)) {