Ultrix 4.1 (etc.) find "" -print not what you expect

Ian! D. Allen [CGL] idallen at watcgl.waterloo.edu
Mon Apr 15 05:52:47 AEST 1991


We all know that Unix treats the null pathname as equivalent to the
current directory.  Try for example: ls ""

Well, don't pass the null pathname to an Ultrix find command -- look what
you get:

    % cd /usr/tmp && find "" -print
    /VIc34646cef
    /VIc34k4ofpu
    /RIc34k4ofpu
    /msg.idallen
    [...etc...]

Look! Absolute pathnames transplanted onto the root file system!  

More interesting, sadly, is this example, perhaps run via the cron:

    cd /usr/tmp && find "" -exec rm -f {} \;

Run this as root and trash anything under "/" that has the same name
as something under /usr/tmp/.  Not nice.

Most other "find" commands we've tried have this fault, too.
We have source; we fixed ours.
-- 
-IAN! (Ian! D. Allen) idallen at watcgl.uwaterloo.ca idallen at watcgl.waterloo.edu
 [129.97.128.64]  Computer Graphics Lab/University of Waterloo/Ontario/Canada



More information about the Comp.unix.ultrix mailing list