Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/login If neither Kerberos IV or Kerberos V are confi...



details:   https://anonhg.NetBSD.org/src/rev/88e359b8436b
branches:  trunk
changeset: 495631:88e359b8436b
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Aug 02 05:58:35 2000 +0000

description:
If neither Kerberos IV or Kerberos V are configured, don't
issue "Warning: no Kerberos tickets issued."

diffstat:

 usr.bin/login/k5login.c |  11 ++++++++---
 usr.bin/login/klogin.c  |  11 ++++++++---
 usr.bin/login/login.c   |  16 +++++++++++++---
 3 files changed, 29 insertions(+), 9 deletions(-)

diffs (143 lines):

diff -r c27bd8119c4c -r 88e359b8436b usr.bin/login/k5login.c
--- a/usr.bin/login/k5login.c   Wed Aug 02 05:24:37 2000 +0000
+++ b/usr.bin/login/k5login.c   Wed Aug 02 05:58:35 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: k5login.c,v 1.12 2000/05/30 06:56:16 aidan Exp $       */
+/*     $NetBSD: k5login.c,v 1.13 2000/08/02 05:58:35 thorpej Exp $     */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)klogin.c   5.11 (Berkeley) 7/12/92";
 #endif
-__RCSID("$NetBSD: k5login.c,v 1.12 2000/05/30 06:56:16 aidan Exp $");
+__RCSID("$NetBSD: k5login.c,v 1.13 2000/08/02 05:58:35 thorpej Exp $");
 #endif /* not lint */
 
 #ifdef KERBEROS5
@@ -59,6 +59,7 @@
 krb5_context kcontext;
 
 int notickets;
+int krb5_configured;
 char *krb5tkfile_env;
 extern char *tty;
 extern int login_krb5_forwardable_tgt;
@@ -194,6 +195,8 @@
        char *realm, *client_name;
        char *principal;
 
+       krb5_configured = 1;
+
        if (login_krb5_forwardable_tgt)
                options |= KDC_OPT_FORWARDABLE;
 
@@ -206,8 +209,10 @@
         * without issuing any tickets.
         */
        if (strcmp(pw->pw_name, "root") == 0 ||
-           krb5_get_default_realm(kcontext, &realm))
+           krb5_get_default_realm(kcontext, &realm)) {
+               krb5_configured = 0;
                return (1);
+       }
 
        /*
         * get TGT for local realm
diff -r c27bd8119c4c -r 88e359b8436b usr.bin/login/klogin.c
--- a/usr.bin/login/klogin.c    Wed Aug 02 05:24:37 2000 +0000
+++ b/usr.bin/login/klogin.c    Wed Aug 02 05:58:35 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: klogin.c,v 1.15 2000/05/30 06:56:17 aidan Exp $        */
+/*     $NetBSD: klogin.c,v 1.16 2000/08/02 05:58:35 thorpej Exp $      */
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)klogin.c   8.3 (Berkeley) 4/2/94";
 #endif
-__RCSID("$NetBSD: klogin.c,v 1.15 2000/05/30 06:56:17 aidan Exp $");
+__RCSID("$NetBSD: klogin.c,v 1.16 2000/08/02 05:58:35 thorpej Exp $");
 #endif /* not lint */
 
 #ifdef KERBEROS
@@ -63,6 +63,7 @@
 #define        VERIFY_SERVICE  "rcmd"
 
 int notickets;
+int krb_configured;
 char *krbtkfile_env;
 char *tty;
 extern int has_ccache;
@@ -90,6 +91,8 @@
        unsigned long faddr;
        char realm[REALM_SZ], savehost[MAXHOSTNAMELEN];
 
+       krb_configured = 1;
+
        /*
         * Root logins don't use Kerberos.
         * If we have a realm, try getting a ticket-granting ticket
@@ -99,8 +102,10 @@
         * without issuing any tickets.
         */
        if (strcmp(pw->pw_name, "root") == 0 ||
-           krb_get_lrealm(realm, 0) != KSUCCESS)
+           krb_get_lrealm(realm, 0) != KSUCCESS) {
+               krb_configured = 0;
                return (1);
+       }
 
        /*
         * get TGT for local realm
diff -r c27bd8119c4c -r 88e359b8436b usr.bin/login/login.c
--- a/usr.bin/login/login.c     Wed Aug 02 05:24:37 2000 +0000
+++ b/usr.bin/login/login.c     Wed Aug 02 05:58:35 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: login.c,v 1.59 2000/07/28 16:36:53 thorpej Exp $       */
+/*     $NetBSD: login.c,v 1.60 2000/08/02 05:58:36 thorpej Exp $       */
 
 /*-
  * Copyright (c) 1980, 1987, 1988, 1991, 1993, 1994
@@ -44,7 +44,7 @@
 #if 0
 static char sccsid[] = "@(#)login.c    8.4 (Berkeley) 4/2/94";
 #endif
-__RCSID("$NetBSD: login.c,v 1.59 2000/07/28 16:36:53 thorpej Exp $");
+__RCSID("$NetBSD: login.c,v 1.60 2000/08/02 05:58:36 thorpej Exp $");
 #endif /* not lint */
 
 /*
@@ -139,11 +139,21 @@
 #endif
 #ifdef KERBEROS
 extern char    *krbtkfile_env;
+extern int     krb_configured;
 #endif
 #ifdef KERBEROS5
 extern krb5_context kcontext;
 extern int     have_forward;
 extern char    *krb5tkfile_env;
+extern int     krb5_configured;
+#endif
+
+#if defined(KERBEROS) && defined(KERBEROS5)
+#define        KERBEROS_CONFIGURED     (krb_configured || krb5_configured)
+#elif defined(KERBEROS)
+#define        KERBEROS_CONFIGURED     krb_configured
+#elif defined(KERBEROS5)
+#define        KERBEROS_CONFIGURED     krb5_configured
 #endif
 
 struct passwd *pwd;
@@ -666,7 +676,7 @@
        }
 
 #if defined(KERBEROS) || defined(KERBEROS5)
-       if (!quietlog && notickets == 1)
+       if (KERBEROS_CONFIGURED && !quietlog && notickets == 1)
                (void)printf("Warning: no Kerberos tickets issued.\n");
 #endif
 



Home | Main Index | Thread Index | Old Index