1KRB5_SET_PASSWORD(3) BSD Library Functions Manual KRB5_SET_PASSWORD(3)
2
4 krb5_change_password, krb5_set_password, krb5_set_password_using_ccache,
5 krb5_passwd_result_to_string — change password functions
6
8 Kerberos 5 Library (libkrb5, -lkrb5)
9
11 #include <krb5.h>
12
13 krb5_error_code
14 krb5_change_password(krb5_context context, krb5_creds *creds,
15 char *newpw, int *result_code, krb5_data *result_code_string,
16 krb5_data *result_string);
17
18 krb5_error_code
19 krb5_set_password(krb5_context context, krb5_creds *creds, char *newpw,
20 krb5_principal targprinc, int *result_code,
21 krb5_data *result_code_string, krb5_data *result_string);
22
23 krb5_error_code
24 krb5_set_password_using_ccache(krb5_context context, krb5_ccache ccache,
25 char *newpw, krb5_principal targprinc, int *result_code,
26 krb5_data *result_code_string, krb5_data *result_string);
27
28 const char *
29 krb5_passwd_result_to_string(krb5_context context, int result);
30
32 These functions change the password for a given principal.
33
34 krb5_set_password() and krb5_set_password_using_ccache() are the newer of
35 the three functions, and use a newer version of the protocol (and also
36 fall back to the older set-password protocol if the newer protocol
37 doesn't work).
38
39 krb5_change_password() sets the password newpasswd for the client princi‐
40 pal in creds. The server principal of creds must be kadmin/changepw.
41
42 krb5_set_password() and krb5_set_password_using_ccache() change the pass‐
43 word for the principal targprinc.
44
45 krb5_set_password() requires that the credential for
46 kadmin/changepw@REALM is in creds. If the user caller isn't an adminis‐
47 trator, this credential needs to be an initial credential, see
48 krb5_get_init_creds(3) how to get such credentials.
49
50 krb5_set_password_using_ccache() will get the credential from ccache.
51
52 If targprinc is NULL, krb5_set_password_using_ccache() uses the the
53 default principal in ccache and krb5_set_password() uses the global the
54 default principal.
55
56 All three functions return an error in result_code and maybe an error
57 string to print in result_string.
58
59 krb5_passwd_result_to_string() returns an human readable string describ‐
60 ing the error code in result_code from the krb5_set_password() functions.
61
63 krb5_ccache(3), krb5_init_context(3)
64
65HEIMDAL July 15, 2004 HEIMDAL