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>

   int
   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.


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to