I have been goofing around trying to mimic the chattr -/+i features of ext2.
I figured out that I can keep directories from being deleted if I copy
/dev/null into a hidden file, say .donotdelete and then chmod 000
.donotdelete.
This keeps users from killing off the directory as they are greeted with a
"permission denied" if they try an rm -r <dirname> or rmdir.
However, what's interesting is that after the user attempts this, the null
file ".donotdelete" disappears. Where does it go? And even though it's
gone, further attempts at removal are still met with "permission denied".
As user root, the file can't be listed nor deleted by name -- it just
vanishes although something thinks it is there because only root can kill the
directory containing the null file.
This is the behavior on my Irix 6.2 box as well (a feather in the cap of
consistency).
Any ideas what's going on?
|