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