diff options
author | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2024-04-17 18:12:13 +0000 |
---|---|---|
committer | Jeremie Courreges-Anglas <jca@cvs.openbsd.org> | 2024-04-17 18:12:13 +0000 |
commit | bd4b25fe144db2d597b3a4b1ebb42791779e00b3 (patch) | |
tree | a1b745116ae3a8eed80792d66750ea223cf16924 /bin | |
parent | 506e4edefac3cd718d2bcde209907588f8d8fae6 (diff) |
Provide a pax format specific option handler
The existing tar_opt() implements support for -o write_opt=nodir for the
old tar and ustar formats. We don't really want to support it for the
pax format, and we want to be able to implement pax format specific
options (even if there are none right now). ok millert@
Diffstat (limited to 'bin')
-rw-r--r-- | bin/pax/extern.h | 3 | ||||
-rw-r--r-- | bin/pax/options.c | 4 | ||||
-rw-r--r-- | bin/pax/tar.c | 25 |
3 files changed, 28 insertions, 4 deletions
diff --git a/bin/pax/extern.h b/bin/pax/extern.h index 6e7031ab18d..c9358dd0b8b 100644 --- a/bin/pax/extern.h +++ b/bin/pax/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.63 2024/04/16 18:52:43 jca Exp $ */ +/* $OpenBSD: extern.h,v 1.64 2024/04/17 18:12:12 jca Exp $ */ /* $NetBSD: extern.h,v 1.5 1996/03/26 23:54:16 mrg Exp $ */ /*- @@ -285,6 +285,7 @@ int ustar_id(char *, int); int ustar_rd(ARCHD *, char *); int ustar_wr(ARCHD *); int pax_id(char *, int); +int pax_opt(void); int pax_wr(ARCHD *); /* diff --git a/bin/pax/options.c b/bin/pax/options.c index 663aea207f4..2e9960168fd 100644 --- a/bin/pax/options.c +++ b/bin/pax/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.113 2024/04/17 10:19:17 jca Exp $ */ +/* $OpenBSD: options.c,v 1.114 2024/04/17 18:12:12 jca Exp $ */ /* $NetBSD: options.c,v 1.6 1996/03/26 23:54:18 mrg Exp $ */ /*- @@ -230,7 +230,7 @@ FSUB fsub[] = { /* 10: POSIX PAX */ {"pax", 5120, BLKMULT, 0, 1, BLKMULT, 0, pax_id, no_op, ustar_rd, tar_endrd, no_op, pax_wr, tar_endwr, tar_trail, - tar_opt}, + pax_opt}, #endif }; #define F_OCPIO 0 /* format when called as cpio -6 */ diff --git a/bin/pax/tar.c b/bin/pax/tar.c index 01f4491ac6b..ef22a9fd2d8 100644 --- a/bin/pax/tar.c +++ b/bin/pax/tar.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tar.c,v 1.84 2024/04/16 22:58:10 jca Exp $ */ +/* $OpenBSD: tar.c,v 1.85 2024/04/17 18:12:12 jca Exp $ */ /* $NetBSD: tar.c,v 1.5 1995/03/21 09:07:49 cgd Exp $ */ /*- @@ -1448,6 +1448,29 @@ pax_wr(ARCHD *arcn) #endif /* + * pax_opt() + * handle pax format specific -o options + * Return: + * 0 if ok -1 otherwise + */ +#ifndef SMALL +int +pax_opt(void) +{ + OPLIST *opt; + + while ((opt = opt_next()) != NULL) { + if (1) { + paxwarn(1, "Unknown pax format -o option/value pair %s=%s", + opt->name, opt->value); + return(-1); + } + } + return 0; +} +#endif + +/* * name_split() * see if the name has to be split for storage in a ustar header. We try * to fit the entire name in the name field without splitting if we can. |