bug-fileutils
[Top][All Lists]
Advanced

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

[PATCH]: -p ignores -m


From: Cody Sherr
Subject: [PATCH]: -p ignores -m
Date: Tue, 30 Oct 2001 14:42:47 -0800 (PST)

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

address@hidden:~/tmp > mkdir -p -m 0750  test/test/test

address@hidden:~/tmp > ls -lad test/
drwxr-xr-x    3 csherr   csherr       4096 Oct 16 15:48 test//

address@hidden:~/tmp > ls -lad test/test/
drwxr-xr-x    3 csherr   csherr       4096 Oct 16 15:48 test/test//

address@hidden:~/tmp > ls -lad test/test/test/
drwxr-x---    2 csherr   csherr       4096 Oct 16 15:48 test/test/test//

address@hidden:~/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: address@hidden

--- 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)





reply via email to

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