aboutsummaryrefslogtreecommitdiff
path: root/archival/tar.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-10-24 23:47:38 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-10-24 23:47:38 +0000
commitebad0294c9ee27669a6e211fa5505987b92804f9 (patch)
tree33f35387efe52539958cf019d18a7b5f92ac81fe /archival/tar.c
parent53c80f09723fa5e9bccd6fbab9c11b14ed520404 (diff)
downloadbusybox-ebad0294c9ee27669a6e211fa5505987b92804f9.tar.gz
tar: fix bug 3844: non-root tar does not preserve perms
Diffstat (limited to 'archival/tar.c')
-rw-r--r--archival/tar.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/archival/tar.c b/archival/tar.c
index 45701c985..503db5f78 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -818,6 +818,10 @@ int tar_main(int argc UNUSED_PARAM, char **argv)
| ARCHIVE_PRESERVE_DATE
| ARCHIVE_EXTRACT_UNCONDITIONAL;
+ /* Apparently only root's tar preserves parms (see bug 3844) */
+ if (getuid() != 0)
+ tar_handle->ah_flags |= ARCHIVE_NOPRESERVE_PERM;
+
/* Prepend '-' to the first argument if required */
opt_complementary = "--:" // first arg is options
"tt:vv:" // count -t,-v