summaryrefslogtreecommitdiff
path: root/auth-krb5.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-11-14 00:02:10 +1100
committerDamien Miller <djm@mindrot.org>2001-11-14 00:02:10 +1100
commit61b05cfdda61737f2d8999e3849dfaea1127f19e (patch)
treefeea73cf988f48d7abfe41979e6cae804f8126f1 /auth-krb5.c
parente49d0966b5e8e4ff4eb993f1b8511932dfcf7bf8 (diff)
- (djm) OpenBSD CVS Sync
- dugsong@cvs.openbsd.org 2001/11/11 18:47:10 [auth-krb5.c] fix krb5 authorization check. found by <jhawk@MIT.EDU>. from art@, deraadt@ ok
Diffstat (limited to 'auth-krb5.c')
-rw-r--r--auth-krb5.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/auth-krb5.c b/auth-krb5.c
index 08c91745..b56f43a9 100644
--- a/auth-krb5.c
+++ b/auth-krb5.c
@@ -2,7 +2,7 @@
* Kerberos v5 authentication and ticket-passing routines.
*
* $FreeBSD: src/crypto/openssh/auth-krb5.c,v 1.6 2001/02/13 16:58:04 assar Exp $
- * $OpenBSD: auth-krb5.c,v 1.1 2001/06/26 16:15:23 dugsong Exp $
+ * $OpenBSD: auth-krb5.c,v 1.2 2001/11/12 01:47:09 dugsong Exp $
*/
#include "includes.h"
@@ -52,8 +52,9 @@ auth_krb5(Authctxt *authctxt, krb5_data *auth, char **client)
krb5_principal server;
krb5_data reply;
krb5_ticket *ticket;
- int fd;
-
+ int fd, ret;
+
+ ret = 0;
server = NULL;
ticket = NULL;
reply.length = 0;
@@ -107,7 +108,8 @@ auth_krb5(Authctxt *authctxt, krb5_data *auth, char **client)
packet_put_string((char *) reply.data, reply.length);
packet_send();
packet_write_wait();
-
+
+ ret = 1;
err:
if (server)
krb5_free_principal(authctxt->krb5_ctx, server);
@@ -116,12 +118,11 @@ auth_krb5(Authctxt *authctxt, krb5_data *auth, char **client)
if (reply.length)
xfree(reply.data);
- if (problem) {
+ if (problem)
debug("Kerberos v5 authentication failed: %s",
krb5_get_err_text(authctxt->krb5_ctx, problem));
- return (0);
- }
- return (1);
+
+ return (ret);
}
int