projects
/
platform
/
upstream
/
coreutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1c4348d
)
(make_dir_parents): Don't let a failed chdir($PWD)
author
Jim Meyering
<jim@meyering.net>
Wed, 15 Jun 2005 08:31:44 +0000
(08:31 +0000)
committer
Jim Meyering
<jim@meyering.net>
Wed, 15 Jun 2005 08:31:44 +0000
(08:31 +0000)
stop us from restricting permissions of just-created absolute-named
directories.
lib/mkdir-p.c
patch
|
blob
|
history
diff --git
a/lib/mkdir-p.c
b/lib/mkdir-p.c
index
a6572a4
..
97775eb
100644
(file)
--- 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));