diff options
-rw-r--r-- | usr.bin/cpio/cmdline.c | 1 | ||||
-rw-r--r-- | usr.bin/cpio/cpio.c | 3 | ||||
-rw-r--r-- | usr.bin/cpio/cpio.h | 1 |
3 files changed, 5 insertions, 0 deletions
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 }; |