From d4145e48ed47f23e39a55a6c56ee3a1bc24970cf Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 15 Jun 2005 08:31:44 +0000 Subject: [PATCH] (make_dir_parents): Don't let a failed chdir($PWD) stop us from restricting permissions of just-created absolute-named directories. --- lib/mkdir-p.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/mkdir-p.c b/lib/mkdir-p.c index a6572a4..97775eb 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)); -- 2.7.4