Bug summary: when the -p option is specified with the -m option, the
parent directories are not created with the permissions specified by -m.
The user's umask are used instead. It seems like this may be the correct
behavior according to POSIX, but it also seems wrong and nonintuitive.
Here is an example with 0750 mode and a 022 umask
csherr@caffeine:~/tmp > mkdir -p -m 0750 test/test/test
csherr@caffeine:~/tmp > ls -lad test/
drwxr-xr-x 3 csherr csherr 4096 Oct 16 15:48 test//
csherr@caffeine:~/tmp > ls -lad test/test/
drwxr-xr-x 3 csherr csherr 4096 Oct 16 15:48 test/test//
csherr@caffeine:~/tmp > ls -lad test/test/test/
drwxr-x--- 2 csherr csherr 4096 Oct 16 15:48 test/test/test//
csherr@caffeine:~/tmp > umask
22
At the end of this email is a patch for the most recent source (4.1) so
that parent directories.
Thanks,
--
Cody Sherr
Engineer
Covalent Technologies
phone: (415)536-5292
email: [EMAIL PROTECTED]
--- src/mkdir.c.orig Tue Oct 16 17:23:02 2001
+++ src/mkdir.c Tue Oct 16 17:23:56 2001
@@ -138,6 +138,7 @@
else if (change == MODE_MEMORY_EXHAUSTED)
xalloc_die ();
newmode = mode_adjust (newmode, change);
+ parent_mode = newmode; /* create the parents w/specified mode */
}
for (; optind < argc; ++optind)
_______________________________________________
Bug-fileutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-fileutils