projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
53c80f0
)
tar: fix bug 3844: non-root tar does not preserve perms
author
Denis Vlasenko
<vda.linux@googlemail.com>
Fri, 24 Oct 2008 23:47:38 +0000
(23:47 -0000)
committer
Denis Vlasenko
<vda.linux@googlemail.com>
Fri, 24 Oct 2008 23:47:38 +0000
(23:47 -0000)
archival/tar.c
patch
|
blob
|
history
diff --git
a/archival/tar.c
b/archival/tar.c
index 45701c985064b7322df44616009659174084a309..503db5f782bf63e60fa074b936ab27b2a5dbe963 100644
(file)
--- 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