From bfc8f843504c60ca9c53b2b9baa676083ce4fef8 Mon Sep 17 00:00:00 2001 From: kientzle Date: Tue, 29 Jul 2008 15:23:31 +0000 Subject: Add --no-preserve-owner, which seems to be required by some ports. Thanks to: Erwin Lansing --- usr.bin/cpio/cmdline.c | 1 + usr.bin/cpio/cpio.c | 3 +++ usr.bin/cpio/cpio.h | 1 + 3 files changed, 5 insertions(+) (limited to 'usr.bin/cpio') diff --git a/usr.bin/cpio/cmdline.c b/usr.bin/cpio/cmdline.c index 29183f1..a9774e9 100644 --- a/usr.bin/cpio/cmdline.c +++ b/usr.bin/cpio/cmdline.c @@ -91,6 +91,7 @@ static const struct option cpio_longopts[] = { { "link", no_argument, NULL, 'l' }, { "list", no_argument, NULL, 't' }, { "make-directories", no_argument, NULL, 'd' }, + { "no-preserve-owner", no_argument, NULL, OPTION_NO_PRESERVE_OWNER }, { "null", no_argument, NULL, '0' }, { "owner", required_argument, NULL, 'R' }, { "pass-through", no_argument, NULL, 'p' }, diff --git a/usr.bin/cpio/cpio.c b/usr.bin/cpio/cpio.c index 77c09cc..991e871 100644 --- a/usr.bin/cpio/cpio.c +++ b/usr.bin/cpio/cpio.c @@ -175,6 +175,9 @@ main(int argc, char *argv[]) case 'm': /* POSIX 1997 */ cpio->extract_flags |= ARCHIVE_EXTRACT_TIME; break; + case OPTION_NO_PRESERVE_OWNER: /* GNU cpio */ + cpio->extract_flags &= ~ARCHIVE_EXTRACT_OWNER; + break; case 'O': /* GNU cpio */ cpio->filename = optarg; break; diff --git a/usr.bin/cpio/cpio.h b/usr.bin/cpio/cpio.h index 7808633..4dce00f 100644 --- a/usr.bin/cpio/cpio.h +++ b/usr.bin/cpio/cpio.h @@ -94,6 +94,7 @@ int owner_parse(const char *, int *, int *); /* Fake short equivalents for long options that otherwise lack them. */ enum { OPTION_INSECURE = 1, + OPTION_NO_PRESERVE_OWNER, OPTION_QUIET, OPTION_VERSION }; -- cgit v1.1