Hi Jeff,
On Tue, Nov 06, 2001 at 10:36:07AM -0500, Jeff Breitner wrote:
>
> 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?
>
I can't make this happen on 6.2 or linux.
I must not be doing what you're doing.
What were the exact steps ?
mkdir testdir
cd testdir
cp /dev/null .donotdelete (or use dd or touch)
chmod 000 .donotdelete
cd ..
rm -r ./testdir
--Tim
|