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
This commit is contained in:
David Malone 2004-05-29 23:27:50 +00:00
parent ac3a1548f8
commit 6f8c264082
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=129853

View File

@ -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 */