diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-04-21 00:52:21 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-04-21 00:52:21 +0000 |
commit | 8b814b4a349e2262c0ad25793b05206a14651ebb (patch) | |
tree | d58a9a4b05e6c662d1ccdcca8da82173d52c1e4b /archival/tar.c | |
parent | 76478b8091d4c3472fb0c7e572c350d150ecd459 (diff) | |
download | busybox-w32-8b814b4a349e2262c0ad25793b05206a14651ebb.tar.gz busybox-w32-8b814b4a349e2262c0ad25793b05206a14651ebb.tar.bz2 busybox-w32-8b814b4a349e2262c0ad25793b05206a14651ebb.zip |
tar: support for tar --numeric-owner. By Natanael Copa.
function old new delta
tar_longopts 221 237 +16
data_extract_all 692 705 +13
tar_main 690 702 +12
Diffstat (limited to 'archival/tar.c')
-rw-r--r-- | archival/tar.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/archival/tar.c b/archival/tar.c index eeaf3586b..03d66a692 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -738,6 +738,7 @@ enum { | |||
738 | USE_FEATURE_SEAMLESS_Z( OPTBIT_COMPRESS ,) | 738 | USE_FEATURE_SEAMLESS_Z( OPTBIT_COMPRESS ,) |
739 | OPTBIT_NOPRESERVE_OWN, | 739 | OPTBIT_NOPRESERVE_OWN, |
740 | OPTBIT_NOPRESERVE_PERM, | 740 | OPTBIT_NOPRESERVE_PERM, |
741 | OPTBIT_NUMERIC_OWNER, | ||
741 | OPT_TEST = 1 << 0, // t | 742 | OPT_TEST = 1 << 0, // t |
742 | OPT_EXTRACT = 1 << 1, // x | 743 | OPT_EXTRACT = 1 << 1, // x |
743 | OPT_BASEDIR = 1 << 2, // C | 744 | OPT_BASEDIR = 1 << 2, // C |
@@ -756,6 +757,7 @@ enum { | |||
756 | OPT_COMPRESS = USE_FEATURE_SEAMLESS_Z( (1 << OPTBIT_COMPRESS )) + 0, // Z | 757 | OPT_COMPRESS = USE_FEATURE_SEAMLESS_Z( (1 << OPTBIT_COMPRESS )) + 0, // Z |
757 | OPT_NOPRESERVE_OWN = 1 << OPTBIT_NOPRESERVE_OWN , // no-same-owner | 758 | OPT_NOPRESERVE_OWN = 1 << OPTBIT_NOPRESERVE_OWN , // no-same-owner |
758 | OPT_NOPRESERVE_PERM = 1 << OPTBIT_NOPRESERVE_PERM, // no-same-permissions | 759 | OPT_NOPRESERVE_PERM = 1 << OPTBIT_NOPRESERVE_PERM, // no-same-permissions |
760 | OPT_NUMERIC_OWNER = 1 << OPTBIT_NUMERIC_OWNER, | ||
759 | }; | 761 | }; |
760 | #if ENABLE_FEATURE_TAR_LONG_OPTIONS | 762 | #if ENABLE_FEATURE_TAR_LONG_OPTIONS |
761 | static const char tar_longopts[] ALIGN1 = | 763 | static const char tar_longopts[] ALIGN1 = |
@@ -787,6 +789,7 @@ static const char tar_longopts[] ALIGN1 = | |||
787 | # if ENABLE_FEATURE_SEAMLESS_Z | 789 | # if ENABLE_FEATURE_SEAMLESS_Z |
788 | "compress\0" No_argument "Z" | 790 | "compress\0" No_argument "Z" |
789 | # endif | 791 | # endif |
792 | "numeric-owner\0" No_argument "\xfc" | ||
790 | "no-same-owner\0" No_argument "\xfd" | 793 | "no-same-owner\0" No_argument "\xfd" |
791 | "no-same-permissions\0" No_argument "\xfe" | 794 | "no-same-permissions\0" No_argument "\xfe" |
792 | /* --exclude takes next bit position in option mask, */ | 795 | /* --exclude takes next bit position in option mask, */ |
@@ -873,6 +876,9 @@ int tar_main(int argc UNUSED_PARAM, char **argv) | |||
873 | if (opt & OPT_NOPRESERVE_PERM) | 876 | if (opt & OPT_NOPRESERVE_PERM) |
874 | tar_handle->ah_flags |= ARCHIVE_NOPRESERVE_PERM; | 877 | tar_handle->ah_flags |= ARCHIVE_NOPRESERVE_PERM; |
875 | 878 | ||
879 | if (opt & OPT_NUMERIC_OWNER) | ||
880 | tar_handle->ah_flags |= ARCHIVE_NUMERIC_OWNER; | ||
881 | |||
876 | if (opt & OPT_GZIP) | 882 | if (opt & OPT_GZIP) |
877 | get_header_ptr = get_header_tar_gz; | 883 | get_header_ptr = get_header_tar_gz; |
878 | 884 | ||