From: Jim Meyering Date: Thu, 9 Nov 2000 22:21:59 +0000 (+0000) Subject: Do not set the permissions of the final directory X-Git-Tag: FILEUTILS-4_0_32~34 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=445485d9b834a13b769b06bec85fcedd47ab9432;p=thirdparty%2Fcoreutils.git Do not set the permissions of the final directory component if it was not just created. Based on a patch from Volker Borchert. --- diff --git a/src/mkdir.c b/src/mkdir.c index bc5ad0e68e..398677fafd 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)