On Mon, 30 Jul 2001 17:45:51 CDT, Charles G Waldman said:
filenames are really evil! (I've always been rather amazed by
the
existence of find(1)'s -print0 argument; I wonder who on Earth came up
with that one?)
If my memory hasn't leaked out of the bit bucket....
-print0 was specifically added to close a security hole in the very
common 'find /tmp -mtime +7 -type f | xargs rm' - Very Bad Karma ensued
if a Bad Guy did this:
mkdir /tmp/foo\n
touch /tm/foo\n/vmunix
(with \n replaced with a newline, of course).
Of course, -print0 *also* fixes the problem where a file "/tmp/one and two"
fed into that xargs would complain that files "one" "and" and
"two" weren't
found....
--
Valdis Kletnieks
Operating Systems Analyst
Virginia Tech