1 .\" Copyright (c) 2003 - 2004 Kungliga Tekniska Högskolan
2 .\" (Royal Institute of Technology, Stockholm, Sweden).
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" 3. Neither the name of the Institute nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" $Heimdal: krb5_set_password.3 14052 2004-07-15 14:39:06Z lha $
36 .Dt KRB5_SET_PASSWORD 3
39 .Nm krb5_change_password ,
40 .Nm krb5_set_password ,
41 .Nm krb5_set_password_using_ccache ,
42 .Nm krb5_passwd_result_to_string
43 .Nd change password functions
45 Kerberos 5 Library (libkrb5, -lkrb5)
49 .Fo krb5_change_password
50 .Fa "krb5_context context"
51 .Fa "krb5_creds *creds"
53 .Fa "int *result_code"
54 .Fa "krb5_data *result_code_string"
55 .Fa "krb5_data *result_string"
59 .Fa "krb5_context context"
60 .Fa "krb5_creds *creds"
62 .Fa "krb5_principal targprinc"
63 .Fa "int *result_code"
64 .Fa "krb5_data *result_code_string"
65 .Fa "krb5_data *result_string"
68 .Fo krb5_set_password_using_ccache
69 .Fa "krb5_context context"
70 .Fa "krb5_ccache ccache"
72 .Fa "krb5_principal targprinc"
73 .Fa "int *result_code"
74 .Fa "krb5_data *result_code_string"
75 .Fa "krb5_data *result_string"
78 .Fo krb5_passwd_result_to_string
79 .Fa "krb5_context context"
83 These functions change the password for a given principal.
87 .Fn krb5_set_password_using_ccache
88 are the newer of the three functions, and use a newer version of the
89 protocol (and also fall back to the older set-password protocol if the
90 newer protocol doesn't work).
92 .Fn krb5_change_password
95 for the client principal in
97 The server principal of creds must be
100 .Fn krb5_set_password
102 .Fn krb5_set_password_using_ccache
103 change the password for the principal
106 .Fn krb5_set_password
107 requires that the credential for
108 .Li kadmin/changepw@REALM
111 If the user caller isn't an administrator, this credential
112 needs to be an initial credential, see
113 .Xr krb5_get_init_creds 3
114 how to get such credentials.
116 .Fn krb5_set_password_using_ccache
117 will get the credential from
124 .Fn krb5_set_password_using_ccache
125 uses the the default principal in
128 .Fn krb5_set_password
129 uses the global the default principal.
131 All three functions return an error in
133 and maybe an error string to print in
136 .Fn krb5_passwd_result_to_string
137 returns an human readable string describing the error code in
140 .Fn krb5_set_password
144 .Xr krb5_init_context 3