diff options
author | Jim Meyering <jim@meyering.net> | 2005-06-15 08:31:44 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2005-06-15 08:31:44 +0000 |
commit | d4145e48ed47f23e39a55a6c56ee3a1bc24970cf (patch) | |
tree | 2fbfab424388c00ed687c1a7476a37035324f8d4 | |
parent | 1c4348d7e87c157b538d0c91abdf425274cbdd42 (diff) | |
download | coreutils-d4145e48ed47f23e39a55a6c56ee3a1bc24970cf.tar.xz |
(make_dir_parents): Don't let a failed chdir($PWD)
stop us from restricting permissions of just-created absolute-named
directories.
-rw-r--r-- | lib/mkdir-p.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/mkdir-p.c b/lib/mkdir-p.c index a6572a41b..97775eb55 100644 --- a/lib/mkdir-p.c +++ b/lib/mkdir-p.c @@ -319,7 +319,8 @@ make_dir_parents (char const *arg, for (; leading_dirs != NULL; leading_dirs = leading_dirs->next) { leading_dirs->dirname_end[0] = '\0'; - if (cwd_problem || chmod (full_dir, parent_mode) != 0) + if ((cwd_problem && *full_dir != '/') + || chmod (full_dir, parent_mode) != 0) { error (0, (cwd_problem ? 0 : errno), _("cannot change permissions of %s"), quote (full_dir)); |