aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2020-04-16 08:51:22 -0700
committerRob Landley <rob@landley.net>2020-04-16 19:00:18 -0500
commitc33dc593b2ff3a2a0b2800c3e4f35806bd5e89ae (patch)
tree6fc44956a5567a6a55916eba66b1c7cc8ff37e31 /toys
parentb98713b1e706f37ff01e9a0dd88caf0cfe0a7d59 (diff)
downloadtoybox-c33dc593b2ff3a2a0b2800c3e4f35806bd5e89ae.tar.gz
cpio: fix tests by removing --trailer.
f2866cf58a07c9d681ecd6695ea969ac70e59a3d fixed the cpio --trailer check as it claimed to, but doing so changed our behavior (since it used to be always-on and is now off unless you supply --trailer). This broke one of the cpio tests. Since I can't find any other cpio that has a --trailer option (or its inverse), this patch removes --trailer. This reverts our behavior to our old behavior (always include the trailer). Judging by the fact that the cpio tests pass with TEST_HOST=1, this seems to be the expected behavior.
Diffstat (limited to 'toys')
-rw-r--r--toys/posix/cpio.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/toys/posix/cpio.c b/toys/posix/cpio.c
index eb76d6cf..64725c13 100644
--- a/toys/posix/cpio.c
+++ b/toys/posix/cpio.c
@@ -16,7 +16,7 @@
* rdevmajor rdevminor namesize check
* This is the equiavlent of mode -H newc when using GNU CPIO.
-USE_CPIO(NEWTOY(cpio, "(no-preserve-owner)(trailer)mduH:p:|i|t|F:v(verbose)o|[!pio][!pot][!pF]", TOYFLAG_BIN))
+USE_CPIO(NEWTOY(cpio, "(no-preserve-owner)mduH:p:|i|t|F:v(verbose)o|[!pio][!pot][!pF]", TOYFLAG_BIN))
config CPIO
bool "cpio"
@@ -34,7 +34,6 @@ config CPIO
-t Test files (list only, stdin=archive, stdout=list of files)
-v Verbose
--no-preserve-owner (don't set ownership during extract)
- --trailer Add legacy trailer (prevents concatenation)
*/
#define FOR_cpio
@@ -274,11 +273,9 @@ void cpio_main(void)
}
free(name);
- if (FLAG(trailer)) {
- memset(toybuf, 0, sizeof(toybuf));
- xwrite(afd, toybuf,
- sprintf(toybuf, "070701%040X%056X%08XTRAILER!!!", 1, 0x0b, 0)+4);
- }
+ memset(toybuf, 0, sizeof(toybuf));
+ xwrite(afd, toybuf,
+ sprintf(toybuf, "070701%040X%056X%08XTRAILER!!!", 1, 0x0b, 0)+4);
}
if (TT.F) xclose(afd);