Brad Oaks writes:

> On Mon, Mar 3, 2008 at 9:19 AM, Smylers <[EMAIL PROTECTED]> wrote:
> 
> > demerphq writes:
> >
> >  > It turned out the problem is that when the tests are root it seems to
> >  > be not possible to create a directory that is not writeable by root.
> >
> >  I think that can be reduced to: It isn't possible to create a directory
> >  that is not writeable by root.  The whole point of root is that as the
> >  super-user it can do anything!
> 
> (I know this is not the point of the conversation, but file this away
> as it might be useful to you some day.)
> As part of being able to do anything, root *can* make a directory that
> it cannot write to.
> 
> Enter the immutable flag:
> 
> [EMAIL PROTECTED] ~]# chattr +i unwritable/

  $ chattr
  -bash: chattr: command not found

> for more info:
> man chattr
> man lsattr

  $ man chattr
  No manual entry for chattr

  $ man lsattr
  No manual entry for lsattr

That's on a FreeBSD server.  Let's try Linux.  Ah, yes:

  $ whatis chattr
  chattr (1)           - change file attributes on a Linux second
  extended file system

So you can make this test work even when running as root, so long as you
don't mind it now failing on Unix-like OSes that aren't Linux.  I'm not
sure that's a nett win!

Smylers

Reply via email to