If neither Kerberos IV or Kerberos V are configured, don't
issue "Warning: no Kerberos tickets issued."
This commit is contained in:
parent
5c4fddaabe
commit
9e2765e474
@ -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 @@ __RCSID("$NetBSD: k5login.c,v 1.12 2000/05/30 06:56:16 aidan Exp $");
|
||||
krb5_context kcontext;
|
||||
|
||||
int notickets;
|
||||
int krb5_configured;
|
||||
char *krb5tkfile_env;
|
||||
extern char *tty;
|
||||
extern int login_krb5_forwardable_tgt;
|
||||
@ -194,6 +195,8 @@ k5login(pw, instance, localhost, password)
|
||||
char *realm, *client_name;
|
||||
char *principal;
|
||||
|
||||
krb5_configured = 1;
|
||||
|
||||
if (login_krb5_forwardable_tgt)
|
||||
options |= KDC_OPT_FORWARDABLE;
|
||||
|
||||
@ -206,8 +209,10 @@ k5login(pw, instance, localhost, password)
|
||||
* 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
|
||||
|
@ -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 @@ __RCSID("$NetBSD: klogin.c,v 1.15 2000/05/30 06:56:17 aidan Exp $");
|
||||
#define VERIFY_SERVICE "rcmd"
|
||||
|
||||
int notickets;
|
||||
int krb_configured;
|
||||
char *krbtkfile_env;
|
||||
char *tty;
|
||||
extern int has_ccache;
|
||||
@ -90,6 +91,8 @@ klogin(pw, instance, localhost, password)
|
||||
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 @@ klogin(pw, instance, localhost, password)
|
||||
* 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
|
||||
|
@ -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 @@ __COPYRIGHT(
|
||||
#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 @@ int has_ccache = 0;
|
||||
#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 @@ main(argc, argv)
|
||||
}
|
||||
|
||||
#if defined(KERBEROS) || defined(KERBEROS5)
|
||||
if (!quietlog && notickets == 1)
|
||||
if (KERBEROS_CONFIGURED && !quietlog && notickets == 1)
|
||||
(void)printf("Warning: no Kerberos tickets issued.\n");
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user