diff options
author | dwmalone <dwmalone@FreeBSD.org> | 2004-05-29 23:27:50 +0000 |
---|---|---|
committer | dwmalone <dwmalone@FreeBSD.org> | 2004-05-29 23:27:50 +0000 |
commit | ce2d6884e8fc1fa3b44565763cc15603de852a04 (patch) | |
tree | 966f093c4d8c63bf04633acb935483c2c00e1a45 /usr.sbin/syslogd | |
parent | daa2b936bfecabf39ab968645507814452f61b46 (diff) | |
download | FreeBSD-src-ce2d6884e8fc1fa3b44565763cc15603de852a04.zip FreeBSD-src-ce2d6884e8fc1fa3b44565763cc15603de852a04.tar.gz |
Exit with a warning if the path to one of the logging sockets is
too long, rather than silently truncating them.
PR: 67139
Inspired by: OpenBSD
Diffstat (limited to 'usr.sbin/syslogd')
-rw-r--r-- | usr.sbin/syslogd/syslogd.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 50adb62..146dfb0 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -371,6 +371,8 @@ main(int argc, char *argv[]) KeepKernFac = 1; break; case 'l': + if (strlen(optarg) >= sizeof(sunx.sun_path)) + errx(1, "%s path too long, exiting", optarg); if (nfunix < MAXFUNIX) funixn[nfunix++] = optarg; else @@ -387,6 +389,8 @@ main(int argc, char *argv[]) use_bootfile = 1; break; case 'p': /* path */ + if (strlen(optarg) >= sizeof(sunx.sun_path)) + errx(1, "%s path too long, exiting", optarg); funixn[0] = optarg; break; case 'P': /* path for alt. PID */ |