Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/dist/ssh fix auth_krb5() error case behavior. found ...



details:   https://anonhg.NetBSD.org/src/rev/92680b1219ef
branches:  trunk
changeset: 517397:92680b1219ef
user:      itojun <itojun%NetBSD.org@localhost>
date:      Mon Nov 12 05:45:29 2001 +0000

description:
fix auth_krb5() error case behavior.  found by jhawk, sync with openbsd tree

diffstat:

 crypto/dist/ssh/auth-krb5.c |  19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diffs (53 lines):

diff -r 55631649a0cd -r 92680b1219ef crypto/dist/ssh/auth-krb5.c
--- a/crypto/dist/ssh/auth-krb5.c       Mon Nov 12 03:23:58 2001 +0000
+++ b/crypto/dist/ssh/auth-krb5.c       Mon Nov 12 05:45:29 2001 +0000
@@ -1,9 +1,9 @@
-/*     $NetBSD: auth-krb5.c,v 1.4 2001/09/27 03:24:02 itojun Exp $     */
+/*     $NetBSD: auth-krb5.c,v 1.5 2001/11/12 05:45:29 itojun Exp $     */
 /*
  *    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"
@@ -53,8 +53,9 @@
        krb5_principal server;
        krb5_data reply;
        krb5_ticket *ticket;
-       int fd;
-       
+       int fd, ret;
+
+       ret = 0;
        server = NULL;
        ticket = NULL;
        reply.length = 0;
@@ -108,7 +109,8 @@
        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);
@@ -117,12 +119,11 @@
        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



Home | Main Index | Thread Index | Old Index