LWN.net Logo

Sanitizing log file output

Sanitizing log file output

Posted Jul 6, 2011 15:15 UTC (Wed) by malor (subscriber, #2973)
In reply to: Sanitizing log file output by nix
Parent article: Sanitizing log file output

I'd actually hit on that in my prior comment, and then felt I was probably digressing a bit too much, and deleted that paragraph. Just as well, because you were more specific anyway.

As you say, it kind of breaks the whole idea of cat, which is to take a stream of bytes from somewhere and echo it to stdout, without changing it. Cat's useful in a zillion different places, and if that filtering code got triggered by accident, it'd make a hell of a mess.

Cat is simple and reliable code, and adding in all that complexity to sanitize something that should have been sanitized in the first place is fundamentally a broken idea. And what about all the other (hundreds?) of programs that might touch dmesg and send it to the console?

In my view, 'don't use cat for dmesg' isn't reasonable. The devs making this argument are saying that the most fundamental Unix tool for echoing text to a screen, is not suitable for echoing text to a screen.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds