diff options
author | Damien Miller <djm@mindrot.org> | 2013-07-20 13:35:45 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2013-07-20 13:35:45 +1000 |
commit | 63ddc899d28cf60045b560891894b9fbf6f822e9 (patch) | |
tree | c6d54f7405a993cc6774d5abe0c0398192ddf008 /auth-krb5.c | |
parent | 1f0e86f23fcebb026371c0888402a981df2a61c4 (diff) |
- djm@cvs.openbsd.org 2013/07/20 01:55:13
[auth-krb5.c gss-serv-krb5.c gss-serv.c]
fix kerberos/GSSAPI deprecation warnings and linking; "looks okay" millert@
Diffstat (limited to 'auth-krb5.c')
-rw-r--r-- | auth-krb5.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/auth-krb5.c b/auth-krb5.c index ff1462ad1..43ee9272f 100644 --- a/auth-krb5.c +++ b/auth-krb5.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: auth-krb5.c,v 1.19 2006/08/03 03:34:41 deraadt Exp $ */ | 1 | /* $OpenBSD: auth-krb5.c,v 1.20 2013/07/20 01:55:13 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Kerberos v5 authentication and ticket-passing routines. | 3 | * Kerberos v5 authentication and ticket-passing routines. |
4 | * | 4 | * |
@@ -79,6 +79,7 @@ auth_krb5_password(Authctxt *authctxt, const char *password) | |||
79 | krb5_ccache ccache = NULL; | 79 | krb5_ccache ccache = NULL; |
80 | int len; | 80 | int len; |
81 | char *client, *platform_client; | 81 | char *client, *platform_client; |
82 | const char *errmsg; | ||
82 | 83 | ||
83 | /* get platform-specific kerberos client principal name (if it exists) */ | 84 | /* get platform-specific kerberos client principal name (if it exists) */ |
84 | platform_client = platform_krb5_get_principal_name(authctxt->pw->pw_name); | 85 | platform_client = platform_krb5_get_principal_name(authctxt->pw->pw_name); |
@@ -96,7 +97,8 @@ auth_krb5_password(Authctxt *authctxt, const char *password) | |||
96 | goto out; | 97 | goto out; |
97 | 98 | ||
98 | #ifdef HEIMDAL | 99 | #ifdef HEIMDAL |
99 | problem = krb5_cc_gen_new(authctxt->krb5_ctx, &krb5_mcc_ops, &ccache); | 100 | problem = krb5_cc_new_unique(authctxt->krb5_ctx, |
101 | krb5_mcc_ops.prefix, NULL, &ccache); | ||
100 | if (problem) | 102 | if (problem) |
101 | goto out; | 103 | goto out; |
102 | 104 | ||
@@ -115,8 +117,8 @@ auth_krb5_password(Authctxt *authctxt, const char *password) | |||
115 | if (problem) | 117 | if (problem) |
116 | goto out; | 118 | goto out; |
117 | 119 | ||
118 | problem = krb5_cc_gen_new(authctxt->krb5_ctx, &krb5_fcc_ops, | 120 | problem = krb5_cc_new_unique(authctxt->krb5_ctx, |
119 | &authctxt->krb5_fwd_ccache); | 121 | krb5_fcc_ops.prefix, NULL, &authctxt->krb5_fwd_ccache); |
120 | if (problem) | 122 | if (problem) |
121 | goto out; | 123 | goto out; |
122 | 124 | ||
@@ -187,10 +189,13 @@ auth_krb5_password(Authctxt *authctxt, const char *password) | |||
187 | if (ccache) | 189 | if (ccache) |
188 | krb5_cc_destroy(authctxt->krb5_ctx, ccache); | 190 | krb5_cc_destroy(authctxt->krb5_ctx, ccache); |
189 | 191 | ||
190 | if (authctxt->krb5_ctx != NULL && problem!=-1) | 192 | if (authctxt->krb5_ctx != NULL && problem!=-1) { |
191 | debug("Kerberos password authentication failed: %s", | 193 | errmsg = krb5_get_error_message(authctxt->krb5_ctx, |
192 | krb5_get_err_text(authctxt->krb5_ctx, problem)); | 194 | problem); |
193 | else | 195 | debug("Kerberos password authentication failed: %s", |
196 | errmsg); | ||
197 | krb5_free_error_message(authctxt->krb5_ctx, errmsg); | ||
198 | } else | ||
194 | debug("Kerberos password authentication failed: %d", | 199 | debug("Kerberos password authentication failed: %d", |
195 | problem); | 200 | problem); |
196 | 201 | ||