usr.bin/login: send errors to console if syslog isn't running

I was debugging why login(1) wasn't working as expected on a minimal
MFS_ROOT disk image. This image doesn't have syslogd running so the
warnings were lost and I had to use GDB to find out why login(1) was
failing (missing PAM libraries) instead of being able to see it in
the console output.

MFC after:	1 week
Reviewed By:	pfg
Differential Revision: https://reviews.freebsd.org/D30892
This commit is contained in:
Alex Richardson 2021-07-06 10:50:05 +01:00
parent d053fb22f6
commit 4d552825ec

View File

@ -199,7 +199,7 @@ main(int argc, char *argv[])
(void)alarm(timeout);
(void)setpriority(PRIO_PROCESS, 0, 0);
openlog("login", 0, LOG_AUTH);
openlog("login", LOG_CONS, LOG_AUTH);
uid = getuid();
euid = geteuid();