Posted Jul 1, 2011 19:06 UTC (Fri) by nix (subscriber, #2304)
[Link]
I can safely say that I have never run dmesg | cat -A in my life, nor would I ever have thought of doing so had it not been for this thread. I don't think syslog-ng has any defence against this yet, either (though doubtless baszi has already added it by now!)
Sanitizing log file output
Posted Jul 1, 2011 20:09 UTC (Fri) by dlang (✭ supporter ✭, #313)
[Link]
for what little it's worth, rsyslog does escape control characters by default.
this is a place that I think a bit of paranoia is good.
what does it hurt to change some characters to hex codes? the readability suffers a tiny bit, but this isn't a novel that you are reading, it's just a log message, and as long as the escaping is done consistantly, does it really matter if you see fooXbar (where X is something other than a ascii printable character) foo#xxxbar (or however you present the escaping)? in either case what you are really going to end up doing is searching or matching the string, and it really doesn't matter which you use for that purpose.
Sanitizing log file output
Posted Jul 1, 2011 20:06 UTC (Fri) by jrn (subscriber, #64214)
[Link]
I would think the usual case is "dmesg | less".
Sanitizing log file output
Posted Jul 1, 2011 20:29 UTC (Fri) by nix (subscriber, #2304)
[Link]
Indeed. This sanitizes things fine as long as you have the right things in $LESS.
Sanitizing log file output
Posted Jul 3, 2011 0:21 UTC (Sun) by mgedmin (subscriber, #34497)
[Link]