From c2d9f80859a86851e495de05fb752047b74d5f7c Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Wed, 13 Nov 2019 10:22:15 +0100 Subject: [PATCH] syslogd: Drop -h flag, does not do anything since 353cd10 Signed-off-by: Joachim Nilsson --- man/syslogd.8 | 18 +----------------- src/syslogd.c | 12 +++--------- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/man/syslogd.8 b/man/syslogd.8 index 8f1e572..37b6a25 100644 --- a/man/syslogd.8 +++ b/man/syslogd.8 @@ -13,7 +13,7 @@ .Nd System Log Daemon .Sh SYNOPSIS .Nm -.Op Fl ?46Adhnsv +.Op Fl ?46Adnsv .Op Fl b Ar addr[:port] .Op Fl b Ar :port .Op Fl f Ar file @@ -117,12 +117,6 @@ section for more information. .It Fl f Ar file Specify an alternative configuration file instead of the default .Pa /etc/syslog.conf . -.It Fl h -By default syslogd will not forward messages it receives from remote -hosts. Specifying this switch on the command line will cause the log -daemon to forward any remote messages it receives to forwarding hosts -which have been defined. This can cause syslog loops that fill up hard -disks quite fast and thus needs to be used with caution. .It Fl m Ar seconds .Nm logs a mark timestamp regularly. The default interval between two @@ -346,16 +340,6 @@ will retry resolving the name ten times before logging the error. Another possibility to avoid this is to place the hostname in .Pa /etc/hosts . .Pp -To avoid syslog-loops (messages that were received from a remote host -are sent back to the same host, or more complicated to a third host that -sends it back to the first one, and so on), -.Nm -by default does not forward remote messages to another remote server. -If this for some reason is required, use the -.Fl h -option on the command line. However, this option needs to be handled -with caution since a syslog loop can fill up hard disks quite fast. -.Pp If the remote host is located in the same domain as the host, .Nm is running on, only the simple hostname will be logged instead of the diff --git a/src/syslogd.c b/src/syslogd.c index 3e95e2f..38e820a 100644 --- a/src/syslogd.c +++ b/src/syslogd.c @@ -136,7 +136,6 @@ static int KeepKernFac; /* Keep remotely logged kernel facility */ static int LastAlarm = 0; /* last value passed to alarm() (seconds) */ static int DupesPending = 0; /* Number of unflushed duplicate messages */ -static int NoHops = 1; /* Can we bounce syslog messages through an intermediate host. */ static off_t RotateSz = 0; /* Max file size (bytes) before rotating, disabled by default */ static int RotateCnt = 5; /* Max number (count) of log files to keep, set with -c */ @@ -194,8 +193,8 @@ static int addpeer(struct peer *pe0) int usage(int code) { printf("Usage:\n" - " syslogd [-46Adnrsvh?] [-b :PORT] [-b ADDR[:PORT]] [-f FILE] [-m SEC]\n" - " [-P PID_FILE] [-p SOCK_PATH] [-R SIZE[:NUM]]\n" + " syslogd [-46Adnrsv?] [-b :PORT] [-b ADDR[:PORT]] [-f FILE] [-m SEC]\n" + " [-P PID_FILE] [-p SOCK_PATH] [-R SIZE[:NUM]]\n" "\n" "Options:\n" " -4 Force IPv4 only\n" @@ -206,7 +205,6 @@ int usage(int code) " as a hostname ath the port as as ervice name, default syslog/514\n" " -d Enable debug mode\n" " -f FILE Alternate .conf file, default: /etc/syslog.conf\n" - " -h Forward messages from other hosts also to remote syslog host(s)\n" " -m SEC Interval between MARK messages in log, 0 to disable, default: 20 min\n" " -n Run in foreground, required when run from a modern init/supervisor\n" " -P FILE File in which to store the process ID, default: %s\n" @@ -247,7 +245,7 @@ int main(int argc, char *argv[]) KeepKernFac = 1; #endif - while ((ch = getopt(argc, argv, "46Ab:dhHf:m:nP:p:r:sv?")) != EOF) { + while ((ch = getopt(argc, argv, "46Ab:dHf:m:nP:p:r:sv?")) != EOF) { switch ((char)ch) { case '4': family = PF_INET; @@ -284,10 +282,6 @@ int main(int argc, char *argv[]) RemoteHostname = 1; break; - case 'h': - NoHops = 0; - break; - case 'm': /* mark interval */ MarkInterval = atoi(optarg) * 60; break;