From 90f75959cbde8620359084e1d80e294e0d1c497d Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Tue, 1 Jul 1997 06:37:29 +0000 Subject: [PATCH] * kadm_rpc_svc.c, server_stubs.c: Add support for setv4key git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10111 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kadmin/server/ChangeLog | 4 +++ src/kadmin/server/kadm_rpc_svc.c | 9 ++++++ src/kadmin/server/server_stubs.c | 55 ++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) diff --git a/src/kadmin/server/ChangeLog b/src/kadmin/server/ChangeLog index ea9cbdb73..7d28b79ba 100644 --- a/src/kadmin/server/ChangeLog +++ b/src/kadmin/server/ChangeLog @@ -1,3 +1,7 @@ +Tue Jul 1 02:36:55 1997 Tom Yu + + * kadm_rpc_svc.c, server_stubs.c: Add support for setv4key. + Mon Mar 31 17:42:03 1997 Barry Jaspan * kadm_rpc_svc.c, server_stubs.c: add support for setkey_principal diff --git a/src/kadmin/server/kadm_rpc_svc.c b/src/kadmin/server/kadm_rpc_svc.c index c4b6ebc59..a012bce98 100644 --- a/src/kadmin/server/kadm_rpc_svc.c +++ b/src/kadmin/server/kadm_rpc_svc.c @@ -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; diff --git a/src/kadmin/server/server_stubs.c b/src/kadmin/server/server_stubs.c index 1d04c03d9..a4015b5c0 100644 --- a/src/kadmin/server/server_stubs.c +++ b/src/kadmin/server/server_stubs.c @@ -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) { -- 2.26.2