From f3d6c94c7f1f88e51a0419cdfc655eeac8856744 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 27 Oct 2005 22:49:08 +0000 Subject: Add --no-same-owner and --no-same-permissions options to tar. --- archival/libunarchive/data_extract_all.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'archival/libunarchive') 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); } -- cgit v1.1