10Sstevel@tonic-gate /*
2*7934SMark.Phalan@Sun.COM * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
30Sstevel@tonic-gate * Use is subject to license terms.
40Sstevel@tonic-gate */
50Sstevel@tonic-gate
60Sstevel@tonic-gate
70Sstevel@tonic-gate /*
80Sstevel@tonic-gate * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
90Sstevel@tonic-gate *
100Sstevel@tonic-gate * Openvision retains the copyright to derivative works of
110Sstevel@tonic-gate * this source code. Do *NOT* create a derivative of this
120Sstevel@tonic-gate * source code before consulting with your legal department.
130Sstevel@tonic-gate * Do *NOT* integrate *ANY* of this source code into another
140Sstevel@tonic-gate * product before consulting with your legal department.
150Sstevel@tonic-gate *
160Sstevel@tonic-gate * For further information, read the top-level Openvision
170Sstevel@tonic-gate * copyright which is contained in the top-level MIT Kerberos
180Sstevel@tonic-gate * copyright.
190Sstevel@tonic-gate *
200Sstevel@tonic-gate * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
210Sstevel@tonic-gate *
220Sstevel@tonic-gate */
230Sstevel@tonic-gate
24*7934SMark.Phalan@Sun.COM #include "server_internal.h"
250Sstevel@tonic-gate #include <kadm5/admin.h>
260Sstevel@tonic-gate
kadm5_chpass_principal_util(void * server_handle,krb5_principal princ,char * new_pw,char ** ret_pw,char * msg_ret,unsigned int msg_len)270Sstevel@tonic-gate kadm5_ret_t kadm5_chpass_principal_util(void *server_handle,
280Sstevel@tonic-gate krb5_principal princ,
290Sstevel@tonic-gate char *new_pw,
300Sstevel@tonic-gate char **ret_pw,
310Sstevel@tonic-gate char *msg_ret,
322881Smp153739 unsigned int msg_len)
330Sstevel@tonic-gate {
340Sstevel@tonic-gate kadm5_server_handle_t handle = server_handle;
350Sstevel@tonic-gate
360Sstevel@tonic-gate CHECK_HANDLE(server_handle);
370Sstevel@tonic-gate return _kadm5_chpass_principal_util(handle, handle->lhandle, princ,
380Sstevel@tonic-gate new_pw, ret_pw, msg_ret, msg_len);
390Sstevel@tonic-gate }
400Sstevel@tonic-gate
410Sstevel@tonic-gate kadm5_ret_t
kadm5_chpass_principal_v2(void * server_handle,krb5_principal princ,char * password,kadm5_ret_t * srvr_rsp_code,krb5_data * srvr_msg)420Sstevel@tonic-gate kadm5_chpass_principal_v2(void *server_handle,
430Sstevel@tonic-gate krb5_principal princ,
440Sstevel@tonic-gate char *password,
450Sstevel@tonic-gate kadm5_ret_t *srvr_rsp_code,
460Sstevel@tonic-gate krb5_data *srvr_msg)
470Sstevel@tonic-gate {
480Sstevel@tonic-gate /* This method of password changing is not supported by the server */
490Sstevel@tonic-gate return (KADM5_FAILURE);
500Sstevel@tonic-gate }
510Sstevel@tonic-gate
520Sstevel@tonic-gate krb5_chgpwd_prot
_kadm5_get_kpasswd_protocol(void * handle)530Sstevel@tonic-gate _kadm5_get_kpasswd_protocol(void *handle)
540Sstevel@tonic-gate {
550Sstevel@tonic-gate /*
560Sstevel@tonic-gate * This has to be here because the higher level doesnt know
570Sstevel@tonic-gate * the details of the handle structure
580Sstevel@tonic-gate */
590Sstevel@tonic-gate kadm5_server_handle_t srvrhdl = (kadm5_server_handle_t)handle;
600Sstevel@tonic-gate
610Sstevel@tonic-gate return (srvrhdl->params.kpasswd_protocol);
620Sstevel@tonic-gate }
63