mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
(make_dir_parents): Don't let a failed chdir($PWD)
stop us from restricting permissions of just-created absolute-named directories.
This commit is contained in:
1 parent
1c4348d7e8
commit
d4145e48ed
1 file changed
+2
-1
+2
-1
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user