Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F139461974
D15279.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D15279.diff
View Options
Index: usr.sbin/syslogd/syslogd.8
===================================================================
--- usr.sbin/syslogd/syslogd.8
+++ usr.sbin/syslogd/syslogd.8
@@ -282,6 +282,9 @@
If
specified twice, no network socket will be opened at all, which also
disables logging to remote machines.
+.It Fl t
+Suppresses the "Forwarded from <log_host_name>: " string added to the
+beginning of the syslog message that is forwarded to a remote log host.
.It Fl T
Always use the local time and date for messages received from the network,
instead of the timestamp field supplied in the message by the remote host.
Index: usr.sbin/syslogd/syslogd.c
===================================================================
--- usr.sbin/syslogd/syslogd.c
+++ usr.sbin/syslogd/syslogd.c
@@ -312,6 +312,7 @@
struct allowedpeer *AllowedPeers; /* List of allowed peers */
static int NumAllowed; /* Number of entries in AllowedPeers */
static int RemoteAddDate; /* Always set the date on remote messages */
+static int RemoteAddForwardedFrom = 1; /* Add "Forwarded From" for forwarded remote messages */
static int UniquePriority; /* Only log specified priority? */
static int LogFacPri; /* Put facility and priority in log message: */
@@ -405,7 +406,7 @@
STAILQ_INIT(&hqueue);
- while ((ch = getopt(argc, argv, "468Aa:b:cCdf:Fkl:m:nNop:P:sS:Tuv"))
+ while ((ch = getopt(argc, argv, "468Aa:b:cCdf:Fkl:m:nNop:P:sS:tTuv"))
!= -1)
switch (ch) {
case '4':
@@ -518,6 +519,9 @@
errx(1, "%s path too long, exiting", optarg);
funix_secure.name = optarg;
break;
+ case 't': /* supress "Forwarded from" for forwarded remote messages */
+ RemoteAddForwardedFrom = 0;
+ break;
case 'T':
RemoteAddDate = 1;
break;
@@ -1270,7 +1274,7 @@
dprintf(" %s\n", f->f_un.f_forw.f_hname);
}
/* check for local vs remote messages */
- if (strcasecmp(f->f_prevhost, LocalHostName))
+ if (RemoteAddForwardedFrom && strcasecmp(f->f_prevhost, LocalHostName))
l = snprintf(line, sizeof line - 1,
"<%d>%.15s Forwarded from %s: %s",
f->f_prevpri, (char *)iov[0].iov_base,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 13, 9:00 AM (8 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26926870
Default Alt Text
D15279.diff (2 KB)
Attached To
Mode
D15279: Add option to syslogd(8) to supress adding "Forwarded from" string for forwarded remote messages
Attached
Detach File
Event Timeline
Log In to Comment