Add -S option which allows to change the pathname of the privileged

socket /var/run/logpriv.

Reviewed by:	glebius and kensmith
MFC after:	2 days
This commit is contained in:
Hiroki Sato 2005-04-13 03:19:41 +00:00
parent f6126e7b40
commit 15f3d79b55
2 changed files with 11 additions and 2 deletions

View File

@ -28,7 +28,7 @@
.\" @(#)syslogd.8 8.1 (Berkeley) 6/6/93
.\" $FreeBSD$
.\"
.Dd November 8, 2004
.Dd April 13, 2005
.Dt SYSLOGD 8
.Os
.Sh NAME
@ -202,6 +202,10 @@ the default is
Specify an alternative file in which to store the process ID.
The default is
.Pa /var/run/syslog.pid .
.It Fl S
Specify the pathname of an alternate log socket for privileged
applications to be used instead; the default is
.Pa /var/run/logpriv .
.It Fl l
Specify a location where
.Nm

View File

@ -356,7 +356,7 @@ main(int argc, char *argv[])
socklen_t len;
bindhostname = NULL;
while ((ch = getopt(argc, argv, "46Aa:b:cdf:kl:m:nop:P:suv")) != -1)
while ((ch = getopt(argc, argv, "46Aa:b:cdf:kl:m:nop:P:sS:uv")) != -1)
switch (ch) {
case '4':
family = PF_INET;
@ -445,6 +445,11 @@ main(int argc, char *argv[])
case 's': /* no network mode */
SecureMode++;
break;
case 'S': /* path for privileged originator */
if (strlen(optarg) >= sizeof(sunx.sun_path))
errx(1, "%s path too long, exiting", optarg);
funix_secure.name = optarg;
break;
case 'u': /* only log specified priority */
UniquePriority++;
break;