summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-11-09 22:21:59 +0000
committerJim Meyering <jim@meyering.net>2000-11-09 22:21:59 +0000
commit445485d9b834a13b769b06bec85fcedd47ab9432 (patch)
treea9b0dd8b44f4b6c621e6d78f0210c642e95842eb /src
parent0fd7aaf38c6eb97b79490239dfa0dcbcef54e6c7 (diff)
downloadcoreutils-445485d9b834a13b769b06bec85fcedd47ab9432.tar.xz
Do not set the permissions of the final directory
component if it was not just created. Based on a patch from Volker Borchert.
Diffstat (limited to 'src')
-rw-r--r--src/mkdir.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mkdir.c b/src/mkdir.c
index bc5ad0e68..398677faf 100644
--- a/src/mkdir.c
+++ b/src/mkdir.c
@@ -174,7 +174,10 @@ main (int argc, char **argv)
This extra step is necessary in some cases when the containing
directory has a default ACL. */
- if (fail == 0 && specified_mode)
+ /* Set the permissions only if this directory has just
+ been created. */
+
+ if (fail == 0 && specified_mode && dir_created)
{
fail = chmod (dir, newmode);
if (fail)