[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "mkdir -p" new child dirs don't inherit default POSIX ACLs properly

From: Paul Eggert
Subject: Re: "mkdir -p" new child dirs don't inherit default POSIX ACLs properly
Date: Fri, 15 Feb 2008 16:30:26 -0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

The only difference between the two traces is that "mkdir
acl-test/mkdir" does this:

  mkdir("acl-test/mkdir", 0777)

whereas "mkdir -p acl-test/mkdir" does the equivalent of this:

  umask (0)
  mkdir("acl-test/mkdir-p", 0755)

Since your initial umask is 022 these two sequences of system calls
should have precisely the same effect, at least in standard POSIX.

I suspect that there some funky thing whereby default ACLs depend on
the umask _independently_ of the mode.  If so, that would explain the
problem.  Perhaps you can investigate this by invoking this little
C program:

   #include <sys/stat.h>

   main (void)
     umask (022);
     mkdir ("acl-test/dir-777", 0777);
     umask (0);
     mkdir ("acl-test/dir-755", 0755);
     return 0;

Here are what the system calls should look like:

   umask(022)                              = (something; it doesn't matter)
   mkdir("acl-test/dir-777", 0777)         = 0
   umask(0)                                = 022
   mkdir("acl-test/dir-755", 0755)         = 0

If the two resulting directories have different ACLs, that would show
that the problem is not specific to GNU mkdir.  Your next task would
then be to figure out why your kernel and/or filesystem is exhibiting
this odd behavior.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]