diff options
| author | Tim Kientzle <kientzle@FreeBSD.org> | 2004-07-17 04:17:50 +0000 |
|---|---|---|
| committer | Tim Kientzle <kientzle@FreeBSD.org> | 2004-07-17 04:17:50 +0000 |
| commit | b3ea6ecd42651a025765798fc7886e03d5dcd6cb (patch) | |
| tree | 6a783750607d4e57db70a54aa149577f9ca0f720 | |
| parent | 70ad92ab84270b5e2d752814c42d78c1560fd554 (diff) | |
Notes
| -rw-r--r-- | usr.bin/tar/bsdtar.c | 7 | ||||
| -rw-r--r-- | usr.bin/tar/bsdtar.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/usr.bin/tar/bsdtar.c b/usr.bin/tar/bsdtar.c index d822851970c42..aad2ba2688dd1 100644 --- a/usr.bin/tar/bsdtar.c +++ b/usr.bin/tar/bsdtar.c @@ -293,6 +293,7 @@ main(int argc, char **argv) bsdtar->option_stdout = 1; break; case 'o': /* SUSv2; note that GNU -o conflicts */ + bsdtar->option_no_owner = 1; bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_OWNER; break; case OPTION_ONE_FILE_SYSTEM: /* -l in GNU tar */ @@ -409,6 +410,12 @@ main(int argc, char **argv) only_mode(bsdtar, mode, "--fast-read", "xt"); if (bsdtar->option_honor_nodump) only_mode(bsdtar, mode, "--nodump", "cru"); + if (bsdtar->option_no_owner) { + only_mode(bsdtar, mode, "-o", "xc"); + /* Warn about nonsensical -co combination, but ignore it. */ + if (mode == 'c') + bsdtar_warnc(bsdtar, 0, "-o is incompatible with -c"); + } if (bsdtar->option_no_subdirs) only_mode(bsdtar, mode, "-n", "cru"); if (bsdtar->option_stdout) diff --git a/usr.bin/tar/bsdtar.h b/usr.bin/tar/bsdtar.h index e4c1761929fa1..712a47de7fc8b 100644 --- a/usr.bin/tar/bsdtar.h +++ b/usr.bin/tar/bsdtar.h @@ -58,6 +58,7 @@ struct bsdtar { char option_fast_read; /* --fast-read */ char option_honor_nodump; /* --nodump */ char option_interactive; /* -w */ + char option_no_owner; /* -o */ char option_no_subdirs; /* -d */ char option_null; /* --null */ char option_stdout; /* -p */ |
