summaryrefslogtreecommitdiff
path: root/archival/tar.c
diff options
context:
space:
mode:
authorMatt Kraai2001-01-13 21:46:25 +0000
committerMatt Kraai2001-01-13 21:46:25 +0000
commit541ffe30a279823c38b745c5e8c4971cb4a6cc41 (patch)
tree8a6e36ab55776b9354e1bfc869e24befb5ccfa21 /archival/tar.c
parent55787401ea16629070a35f6d46235e648f730870 (diff)
downloadbusybox-541ffe30a279823c38b745c5e8c4971cb4a6cc41.zip
busybox-541ffe30a279823c38b745c5e8c4971cb4a6cc41.tar.gz
Fix ownership of extracted directories.
Diffstat (limited to 'archival/tar.c')
-rw-r--r--archival/tar.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/archival/tar.c b/archival/tar.c
index 9a3cff3..8445595 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -426,9 +426,12 @@ tarExtractDirectory(TarInfo *header, int extractFlag, int tostdoutFlag)
/* make the final component, just in case it was
* omitted by create_path() (which will skip the
* directory if it doesn't have a terminating '/') */
- if (mkdir(header->name, header->mode) == 0) {
- fixUpPermissions(header);
+ if (mkdir(header->name, header->mode) < 0 && errno != EEXIST) {
+ perror_msg("%s", header->name);
+ return FALSE;
}
+
+ fixUpPermissions(header);
return( TRUE);
}