* kadm_rpc_svc.c, server_stubs.c: Add support for setv4key
authorTom Yu <tlyu@mit.edu>
Tue, 1 Jul 1997 06:37:29 +0000 (06:37 +0000)
committerTom Yu <tlyu@mit.edu>
Tue, 1 Jul 1997 06:37:29 +0000 (06:37 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10111 dc483132-0cff-0310-8789-dd5450dbe970

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

index ea9cbdb73e1d410e4e5bfea605c3e930f156bb42..7d28b79baaeaf00d27dce33e708b43d194c78bfe 100644 (file)
@@ -1,3 +1,7 @@
+Tue Jul  1 02:36:55 1997  Tom Yu  <tlyu@mit.edu>
+
+       * kadm_rpc_svc.c, server_stubs.c: Add support for setv4key.
+
 Mon Mar 31 17:42:03 1997  Barry Jaspan  <bjaspan@mit.edu>
 
        * kadm_rpc_svc.c, server_stubs.c: add support for setkey_principal
index c4b6ebc598bf5f93f7c8c10bc5cbf5d0bdc815c6..a012bce98ae1d6e76c4d2e918d61c4d70c4dfe31 100644 (file)
@@ -5,6 +5,9 @@
  * $Source$
  * 
  * $Log$
+ * Revision 1.14  1997/07/01 06:37:28  tlyu
+ *     * kadm_rpc_svc.c, server_stubs.c: Add support for setv4key.
+ *
  * Revision 1.13  1997/04/23 19:53:11  bjaspan
  * add kadm5_setkey_principal
  *
@@ -177,6 +180,12 @@ void kadm_1(rqstp, transp)
          local = (char *(*)()) chpass_principal_1;
          break;
 
+     case SETV4KEY_PRINCIPAL:
+         xdr_argument = xdr_setv4key_arg;
+         xdr_result = xdr_generic_ret;
+         local = (char *(*)()) setv4key_principal_1;
+         break;
+
      case SETKEY_PRINCIPAL:
          xdr_argument = xdr_setkey_arg;
          xdr_result = xdr_generic_ret;
index 1d04c03d93d92c0a331dcd75152543afe2a64058..a4015b5c00df6a86f5da288318cdc628336d642c 100644 (file)
@@ -611,6 +611,61 @@ chpass_principal_1(chpass_arg *arg, struct svc_req *rqstp)
     return &ret;
 }
 
+generic_ret *
+setv4key_principal_1(setv4key_arg *arg, struct svc_req *rqstp)
+{
+    static generic_ret             ret;
+    char                           *prime_arg;
+    gss_buffer_desc                client_name,
+                                   service_name;
+    OM_uint32                      minor_stat;
+    kadm5_server_handle_t          handle;
+
+    xdr_free(xdr_generic_ret, &ret);
+
+    if (ret.code = new_server_handle(arg->api_version, rqstp, &handle))
+        return &ret;
+
+    if (ret.code = check_handle((void *)handle)) {
+        free_server_handle(handle);
+        return &ret;
+    }
+
+    ret.api_version = handle->api_version;
+
+    if (setup_gss_names(rqstp, &client_name, &service_name) < 0) {
+        ret.code = KADM5_FAILURE;
+        return &ret;
+    }
+    krb5_unparse_name(handle->context, arg->princ, &prime_arg);
+
+    if (!(CHANGEPW_SERVICE(rqstp)) &&
+              acl_check(handle->context, rqstp->rq_clntcred,
+                        ACL_SETKEY, arg->princ)) {
+        ret.code = kadm5_setv4key_principal((void *)handle, arg->princ,
+                                            arg->keyblock);
+    } else {
+        krb5_klog_syslog(LOG_NOTICE, LOG_UNAUTH, "kadm5_setv4key_principal",
+               prime_arg, client_name.value, service_name.value,
+               inet_ntoa(rqstp->rq_xprt->xp_raddr.sin_addr));
+        ret.code = KADM5_AUTH_SETKEY;
+    }
+
+    if(ret.code != KADM5_AUTH_SETKEY) {
+       krb5_klog_syslog(LOG_NOTICE, LOG_DONE, "kadm5_setv4key_principal", 
+              prime_arg, ((ret.code == 0) ? "success" :
+                          error_message(ret.code)), 
+              client_name.value, service_name.value,
+              inet_ntoa(rqstp->rq_xprt->xp_raddr.sin_addr));
+    }
+
+    free_server_handle(handle);
+    free(prime_arg);
+    gss_release_buffer(&minor_stat, &client_name);
+    gss_release_buffer(&minor_stat, &service_name);
+    return &ret;
+}
+
 generic_ret *
 setkey_principal_1(setkey_arg *arg, struct svc_req *rqstp)
 {