xref: /illumos-gate/usr/src/lib/krb5/kadm5/srv/svr_chpass_util.c (revision 0250c53ad267726f2438e3c6556199a0bbf588a2)
1 /*
2  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 
7 /*
8  * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
9  *
10  *	Openvision retains the copyright to derivative works of
11  *	this source code.  Do *NOT* create a derivative of this
12  *	source code before consulting with your legal department.
13  *	Do *NOT* integrate *ANY* of this source code into another
14  *	product before consulting with your legal department.
15  *
16  *	For further information, read the top-level Openvision
17  *	copyright which is contained in the top-level MIT Kerberos
18  *	copyright.
19  *
20  * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
21  *
22  */
23 
24 #include "server_internal.h"
25 #include <kadm5/admin.h>
26 
27 kadm5_ret_t kadm5_chpass_principal_util(void *server_handle,
28 					krb5_principal princ,
29 					char *new_pw,
30 					char **ret_pw,
31 					char *msg_ret,
32 					unsigned int msg_len)
33 {
34   kadm5_server_handle_t handle = server_handle;
35 
36   CHECK_HANDLE(server_handle);
37   return _kadm5_chpass_principal_util(handle, handle->lhandle, princ,
38 				      new_pw, ret_pw, msg_ret, msg_len);
39 }
40 
41 kadm5_ret_t
42 kadm5_chpass_principal_v2(void *server_handle,
43 			krb5_principal princ,
44 			char *password,
45 			kadm5_ret_t *srvr_rsp_code,
46 			krb5_data *srvr_msg)
47 {
48 	/* This method of password changing is not supported by the server */
49 	return (KADM5_FAILURE);
50 }
51 
52 krb5_chgpwd_prot
53 _kadm5_get_kpasswd_protocol(void *handle)
54 {
55 	/*
56 	 * This has to be here because the higher level doesnt know
57 	 * the details of the handle structure
58 	 */
59 	kadm5_server_handle_t srvrhdl = (kadm5_server_handle_t)handle;
60 
61 	return (srvrhdl->params.kpasswd_protocol);
62 }
63