From 02c3c9457eccffef441daf195cbce656e45cd926 Mon Sep 17 00:00:00 2001 From: Hiroki Sato Date: Thu, 5 May 2005 17:46:04 +0000 Subject: Add -S option which allows to change the pathname of the privileged socket /var/run/logpriv. MFS from: src/usr.sbin/syslogd/syslogd.8 1.52.2.5 src/usr.sbin/syslogd/syslogd.c 1.131.2.3 Approved by: re (kensmith) --- usr.sbin/syslogd/syslogd.8 | 6 +++++- usr.sbin/syslogd/syslogd.c | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/syslogd/syslogd.8 b/usr.sbin/syslogd/syslogd.8 index d15b0ab1467b9..e5905e46eadd8 100644 --- a/usr.sbin/syslogd/syslogd.8 +++ b/usr.sbin/syslogd/syslogd.8 @@ -28,7 +28,7 @@ .\" @(#)syslogd.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd November 8, 2004 +.Dd May 5, 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 diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 52f757b53c450..71a77c3940295 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -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; -- cgit v1.3