SCCS-vsn: usr.bin/login/login.c 5.45
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)login.c 5.44 (Berkeley) %G%";
+static char sccsid[] = "@(#)login.c 5.45 (Berkeley) %G%";
(void)printf("Logging in with home = \"/\".\n");
}
(void)printf("Logging in with home = \"/\".\n");
}
#define TWOWEEKS (14*24*60*60)
if (pwd->pw_change || pwd->pw_expire)
(void)gettimeofday(&tp, (struct timezone *)NULL);
#define TWOWEEKS (14*24*60*60)
if (pwd->pw_change || pwd->pw_expire)
(void)gettimeofday(&tp, (struct timezone *)NULL);
months[ttp->tm_mon], ttp->tm_mday,
TM_YEAR_BASE + ttp->tm_year);
}
months[ttp->tm_mon], ttp->tm_mday,
TM_YEAR_BASE + ttp->tm_year);
}
/* nothing else left to fail -- really log in */
{
/* nothing else left to fail -- really log in */
{
strcpy(tbuf + 1, (p = rindex(pwd->pw_shell, '/')) ?
p + 1 : pwd->pw_shell);
strcpy(tbuf + 1, (p = rindex(pwd->pw_shell, '/')) ?
p + 1 : pwd->pw_shell);
if (setlogname(pwd->pw_name, strlen(pwd->pw_name)) < 0)
syslog(LOG_ERR, "setlogname() failure: %m");
if (setlogname(pwd->pw_name, strlen(pwd->pw_name)) < 0)
syslog(LOG_ERR, "setlogname() failure: %m");
/* discard permissions last so can't get killed and drop core */
(void)setuid(pwd->pw_uid);
/* discard permissions last so can't get killed and drop core */
(void)setuid(pwd->pw_uid);