diff options
| author | christos <christos@NetBSD.org> | 2012-04-24 16:52:26 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2012-04-24 16:52:26 +0000 |
| commit | 0df12bd0cb6cff47f72540bf23aab3ac613ad00a (patch) | |
| tree | bb67b433f3188f8c36f528e4401732c704b59918 | |
| parent | a61cfc9d7ebe402cf39f96cb12ad035a3a263d39 (diff) | |
no more KRB5_DEPRECATED
| -rw-r--r-- | usr.bin/login/Makefile | 4 | ||||
| -rw-r--r-- | usr.bin/login/k5login.c | 49 |
2 files changed, 3 insertions, 50 deletions
diff --git a/usr.bin/login/Makefile b/usr.bin/login/Makefile index 738f96ee43f..dd2ee14d6f5 100644 --- a/usr.bin/login/Makefile +++ b/usr.bin/login/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.54 2012/04/23 20:54:40 christos Exp $ +# $NetBSD: Makefile,v 1.55 2012/04/24 16:52:26 christos Exp $ # @(#)Makefile 8.1 (Berkeley) 7/19/93 WARNS?= 5 @@ -25,8 +25,6 @@ CPPFLAGS+=-DLOGIN_CAP -DSUPPORT_UTMP -DSUPPORT_UTMPX .if (${USE_KERBEROS} != "no") SRCS+= k5login.c CPPFLAGS+=-DKERBEROS5 -# XXX: for krb5_get_in_tkt_with_password -CPPFLAGS+=-DKRB5_DEPRECATED= DPADD+= ${LIBKRB5} ${LIBASN1} LDADD+= -lkrb5 -lasn1 diff --git a/usr.bin/login/k5login.c b/usr.bin/login/k5login.c index 70e12c5f7b4..ad773e98d0e 100644 --- a/usr.bin/login/k5login.c +++ b/usr.bin/login/k5login.c @@ -1,4 +1,4 @@ -/* $NetBSD: k5login.c,v 1.32 2012/04/24 16:51:19 christos Exp $ */ +/* $NetBSD: k5login.c,v 1.33 2012/04/24 16:52:26 christos Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -51,7 +51,7 @@ #if 0 static char sccsid[] = "@(#)klogin.c 5.11 (Berkeley) 7/12/92"; #endif -__RCSID("$NetBSD: k5login.c,v 1.32 2012/04/24 16:51:19 christos Exp $"); +__RCSID("$NetBSD: k5login.c,v 1.33 2012/04/24 16:52:26 christos Exp $"); #endif /* not lint */ #ifdef KERBEROS5 @@ -400,50 +400,6 @@ k5login(struct passwd *pw, char *instance, char *localhost, char *password) } memset(&my_creds, 0, sizeof(my_creds)); -#if 0 - krb5_principal server; - krb5_timestamp now; - long lifetime = KRB5_DEFAULT_LIFE; - - my_creds.client = me; - - const char *xrealm = krb5_principal_get_realm(kcontext, me); - size_t rlen = strlen(xrealm); - if ((kerror = krb5_build_principal_ext(kcontext, - &server, - rlen, xrealm, - KRB5_TGS_NAME_SIZE, - KRB5_TGS_NAME, - rlen, xrealm, - 0)) != 0) { - k5_log(kcontext, kerror, "while building server name"); - return (1); - } - - my_creds.server = server; - - if ((kerror = krb5_timeofday(kcontext, &now)) != 0) { - k5_log(kcontext, kerror, "while getting time of day"); - return (1); - } - - my_creds.times.starttime = 0; /* start timer when request - gets to KDC */ - my_creds.times.endtime = now + lifetime; - my_creds.times.renew_till = 0; - - int options = KRB5_DEFAULT_OPTIONS; - - if (login_krb5_forwardable_tgt) - options |= KDC_OPT_FORWARDABLE; - - kerror = krb5_get_in_tkt_with_password(kcontext, options, - NULL, NULL, NULL, password, ccache, &my_creds, 0); - - if (my_creds.server != NULL) - krb5_free_principal(kcontext, my_creds.server); -#else - /* This does not work yet */ krb5_get_init_creds_opt *opt; if ((kerror = krb5_get_init_creds_opt_alloc(kcontext, &opt)) != 0) { @@ -459,7 +415,6 @@ k5login(struct passwd *pw, char *instance, char *localhost, char *password) krb5_get_init_creds_opt_free(kcontext, opt); if (kerror == 0) kerror = krb5_cc_store_cred(kcontext, ccache, &my_creds); -#endif if (chown(&tkt_location[5], pw->pw_uid, pw->pw_gid) < 0) syslog(LOG_ERR, "chown tkfile (%s): %m", &tkt_location[5]); |
