summaryrefslogtreecommitdiff
path: root/archival/libunarchive/data_extract_all.c
diff options
context:
space:
mode:
authorRob Landley2005-10-27 22:49:08 +0000
committerRob Landley2005-10-27 22:49:08 +0000
commitf3d6c94c7f1f88e51a0419cdfc655eeac8856744 (patch)
tree389bc49a21f1d0b34cd81b1cde3e769f0899295f /archival/libunarchive/data_extract_all.c
parent47ea7b7f96e0ba76514a4f24177dc0e3e5ec30a0 (diff)
downloadbusybox-f3d6c94c7f1f88e51a0419cdfc655eeac8856744.zip
busybox-f3d6c94c7f1f88e51a0419cdfc655eeac8856744.tar.gz
Add --no-same-owner and --no-same-permissions options to tar.
Diffstat (limited to 'archival/libunarchive/data_extract_all.c')
-rw-r--r--archival/libunarchive/data_extract_all.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/archival/libunarchive/data_extract_all.c b/archival/libunarchive/data_extract_all.c
index d10d665..42e4423 100644
--- a/archival/libunarchive/data_extract_all.c
+++ b/archival/libunarchive/data_extract_all.c
@@ -111,8 +111,12 @@ extern void data_extract_all(archive_handle_t *archive_handle)
}
}
- lchown(file_header->name, file_header->uid, file_header->gid);
- if ((file_header->mode & S_IFMT) != S_IFLNK) {
+ if (!(archive_handle->flags & ARCHIVE_NOPRESERVE_OWN)) {
+ lchown(file_header->name, file_header->uid, file_header->gid);
+ }
+ if (!(archive_handle->flags & ARCHIVE_NOPRESERVE_PERM) &&
+ (file_header->mode & S_IFMT) != S_IFLNK)
+ {
chmod(file_header->name, file_header->mode);
}