SCCS-vsn: usr.bin/login/login.c 5.44
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)login.c 5.43 (Berkeley) %G%";
+static char sccsid[] = "@(#)login.c 5.44 (Berkeley) %G%";
break;
case '?':
default:
break;
case '?':
default:
+ syslog(LOG_ERR, "invalid flag");
(void)fprintf(stderr,
"usage: login [-fp] [username]\n");
exit(1);
(void)fprintf(stderr,
"usage: login [-fp] [username]\n");
exit(1);
if (fflag && pwd) {
int uid = getuid();
if (fflag && pwd) {
int uid = getuid();
- passwd_req = pwd->pw_uid == 0 ||
+ passwd_req =
+#ifndef KERBEROS
+ pwd->pw_uid == 0 ||
+#endif
(uid && uid != pwd->pw_uid);
}
(uid && uid != pwd->pw_uid);
}
(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);
motd()
{
register int fd, nchars;
motd()
{
register int fd, nchars;
- int (*oldint)(), sigint();
+ sig_t oldint;
+ int sigint();
char tbuf[8192];
if ((fd = open(_PATH_MOTDFILE, O_RDONLY, 0)) < 0)
char tbuf[8192];
if ((fd = open(_PATH_MOTDFILE, O_RDONLY, 0)) < 0)