Util-Linux package development
 help / color / mirror / Atom feed
* logger --tag
@ 2015-03-10 17:32 Rainer Gerhards
  2015-03-11  9:56 ` Sami Kerola
  0 siblings, 1 reply; 3+ messages in thread
From: Rainer Gerhards @ 2015-03-10 17:32 UTC (permalink / raw)
  To: util-linux

Hi all,

I have been working on some fixes to logger the past days (issues are
available on github). While I am almost done with that, I just noticed
a problem that seems to exist for rather long (at least it is present
in 2.20):

logger accepts spaces in the tag name, e.g.

logger -t "tag with spaces" test

This will lead to a tag "tag with spaces:" being written. Actually, in
2.20 this is a problem of syslog(3), which should not accept spaces.

Spaces are invalid inside a tag value (rfc 3164, rfc5424 and
traditional log socket format). The lead to misinterpretation. In the
case of rsyslog, the problem is not easily visible to the casual
observer, but can cause problems e.g. when writing logs to databases
or other tabular frontends.

When the new --rfc5424 option is used, a space inside the tag
invalidates the message (5424 is strict in contrary to 3164).

As the bug seems to be present for a long time, probably ever since, I
am unsure how to handle that. Options are (among others):

1) be to be strict by default, and emit an error message if a space is
contained inside a tag value. But that could potentially break
existing scripts.

2) be strict if and only if --rfc5424 is selected, but keep lazy in
all other cases

3) be strict if any rfc format is specified, but keep lazy in all other cases.

4) add a new option --strict (or whatever) and emit an error if it
either --rfc3164, --rfc5424 *or* --strict is given (--strict would
only affect system log socket format).

Options 2 to 4 would not break existing scripts, as these are new 2.26
options. I tend to option 4, which has the only downside that we still
permit invalid format to the local log socket.

What is the opinion here on this list?

Thanks,
Rainer

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-11 12:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-10 17:32 logger --tag Rainer Gerhards
2015-03-11  9:56 ` Sami Kerola
2015-03-11 12:03   ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox