Hacker Newsnew | past | comments | ask | show | jobs | submit | thisaccount's commentslogin

Wonder what would happen if you hid a symlink pointing to root as one of the files. Someone without a doubt would rm-rf.


rm -rf doesn't follow symlinks:

    /tmp $ mkdir -p a/b/c
    /tmp $ mkdir -p a/d/e
    /tmp $ cd a/b/c
    /tmp/a/b/c $ ln -s /tmp/a/d .
    /tmp/a/b/c $ cd ../../
    /tmp/a $ ls */*
    b/c:
    d

    d/e:
    /tmp/a $ rm -rf b
    /tmp/a $ ls
    d
It would be pretty stupid for it to.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: