From: Charles Wilson Date: Thu, 19 Mar 2009 03:02:36 +0000 (-0400) Subject: Issue 15, part 7. Add --same-owner option to bsdtar. X-Git-Tag: v2.7.0~131 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f37c4e79f272be4cd0747e26325d7c18aa9f85a9;p=thirdparty%2Flibarchive.git Issue 15, part 7. Add --same-owner option to bsdtar. SVN-Revision: 803 --- diff --git a/tar/bsdtar.c b/tar/bsdtar.c index 138c940b7..d04e8fae2 100644 --- a/tar/bsdtar.c +++ b/tar/bsdtar.c @@ -416,6 +416,9 @@ main(int argc, char **argv) usage(bsdtar); #endif break; + case OPTION_SAME_OWNER: /* GNU tar */ + bsdtar->extract_flags |= ARCHIVE_EXTRACT_OWNER; + break; case OPTION_STRIP_COMPONENTS: /* GNU tar 1.15 */ bsdtar->strip_components = atoi(bsdtar->optarg); break; diff --git a/tar/bsdtar.h b/tar/bsdtar.h index 168849c12..e73a2d7c7 100644 --- a/tar/bsdtar.h +++ b/tar/bsdtar.h @@ -127,6 +127,7 @@ enum { OPTION_NUMERIC_OWNER, OPTION_ONE_FILE_SYSTEM, OPTION_POSIX, + OPTION_SAME_OWNER, OPTION_STRIP_COMPONENTS, OPTION_TOTALS, OPTION_USE_COMPRESS_PROGRAM, diff --git a/tar/cmdline.c b/tar/cmdline.c index 42c832485..ea270c8f7 100644 --- a/tar/cmdline.c +++ b/tar/cmdline.c @@ -112,6 +112,7 @@ static struct option { { "posix", 0, OPTION_POSIX }, { "preserve-permissions", 0, 'p' }, { "read-full-blocks", 0, 'B' }, + { "same-owner", 0, OPTION_SAME_OWNER }, { "same-permissions", 0, 'p' }, { "strip-components", 1, OPTION_STRIP_COMPONENTS }, { "to-stdout", 0, 'O' },