freebsd-src/usr.sbin/syslogd
Jake Freeland d556719e15 syslogd: Keep console and tty descriptors open
Console and tty descriptors are initially opened in parse_action() to
determine whether they are valid using isatty(). That descriptor is then
closed because it is never accessed by syslogd again; ttymsg() will reopen
the tty/console under a new descriptor when needed.

If the user attempts to log to a tty that is inactive outside of
syslogd, then syslogd must keep that descriptor open so the tty remains
accessible. For example, logging to `/dev/ttyvb` requires the initial
`/dev/ttyvb` descriptor to stay open so the user can view its buffer at
any time via CTRL+ALT+F12.

As a result, console and tty descriptors must remain open until a
potential configuration reload or a system shutdown. The given
descriptor will be closed in close_filed() in such circumstances.

PR:		274454
Fixes:		c3175a6e1c ("syslogd: Do not open console descriptor")
Reported by:	Trond Endrestøl <Trond.Endrestol@ximalas.info>
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D42215
2023-10-16 09:11:58 -04:00
..
tests syslogd: Prevent running tests in parallel 2023-10-11 12:24:42 +02:00
ftp.conf Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
lpr.conf Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile syslogd: Add some basic regression tests 2023-08-23 12:17:40 -04:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
pathnames.h Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:23 -06:00
ppp.conf Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
syslog.conf Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
syslog.conf.5 Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
syslogd.8 Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
syslogd.c syslogd: Keep console and tty descriptors open 2023-10-16 09:11:58 -04:00