Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/login 1. Restore missing tty action.
details: https://anonhg.NetBSD.org/src/rev/e80301f3fb07
branches: trunk
changeset: 574513:e80301f3fb07
user: christos <christos%NetBSD.org@localhost>
date: Thu Mar 03 02:06:16 2005 +0000
description:
1. Restore missing tty action.
2. Pass the nested user name to pam.
3. always try to fill in sockaddr.
diffstat:
usr.bin/login/login_pam.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diffs (50 lines):
diff -r dd62caed24d6 -r e80301f3fb07 usr.bin/login/login_pam.c
--- a/usr.bin/login/login_pam.c Wed Mar 02 22:11:03 2005 +0000
+++ b/usr.bin/login/login_pam.c Thu Mar 03 02:06:16 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: login_pam.c,v 1.3 2005/02/28 16:11:36 christos Exp $ */
+/* $NetBSD: login_pam.c,v 1.4 2005/03/03 02:06:16 christos Exp $ */
/*-
* Copyright (c) 1980, 1987, 1988, 1991, 1993, 1994
@@ -40,7 +40,7 @@
#if 0
static char sccsid[] = "@(#)login.c 8.4 (Berkeley) 4/2/94";
#endif
-__RCSID("$NetBSD: login_pam.c,v 1.3 2005/02/28 16:11:36 christos Exp $");
+__RCSID("$NetBSD: login_pam.c,v 1.4 2005/03/03 02:06:16 christos Exp $");
#endif /* not lint */
/*
@@ -308,10 +308,12 @@
} while (/*CONSTCOND*/0)
/*
- * Fill hostname and tty
+ * Fill hostname tty, and nested user
*/
PAM_SET_ITEM(PAM_RHOST, hostname);
PAM_SET_ITEM(PAM_TTY, tty);
+ if (nested)
+ PAM_SET_ITEM(PAM_NUSER, nested);
if (have_ss)
PAM_SET_ITEM(PAM_SOCKADDR, &ss);
@@ -461,6 +463,9 @@
(void)chown(ttyn, pwd->pw_uid,
(gr = getgrnam(TTYGRPNAME)) ? gr->gr_gid : pwd->pw_gid);
+ if (ttyaction(ttyn, "login", pwd->pw_name))
+ (void)printf("Warning: ttyaction failed.\n");
+
/* Nothing else left to fail -- really log in. */
update_db(quietlog);
@@ -750,7 +755,6 @@
syslog(LOG_NOTICE, "%s to %s on tty %s", nested,
pwd->pw_name, tty);
- return;
}
if (hostname != NULL && have_ss == 0) {
socklen_t len = sizeof(ss);
Home |
Main Index |
Thread Index |
Old Index