aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2021-03-08 09:47:54 -0800
committerRob Landley <rob@landley.net>2021-03-09 03:54:59 -0600
commit5c6628e724e9d3625f161db077b15b232e2ca096 (patch)
tree333fdc1b9038652017cd95aa94efedf29eda9f9a /tests
parent668572a8650f3d4ff0fbe54ea07499b941244bdb (diff)
downloadtoybox-5c6628e724e9d3625f161db077b15b232e2ca096.tar.gz
tar: fix base-256 output.
A tar file created by toybox tar with values large enough to need base-256 rather than ASCII octal caused a tar reader to crash, and caused GNU tar to complain. I note from the docs at https://github.com/libarchive/libarchive/blob/master/libarchive/tar.5#L326 that they imply that only the top *bit* should be set to indicate this format, not the whole top byte, to give a 95-bit or 63-bit field. But I don't think we can hit that in practice? Bug: http://issuetracker.google.com/181683612
Diffstat (limited to 'tests')
-rw-r--r--tests/tar.test5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/tar.test b/tests/tar.test
index 4b2f2120..70668c9c 100644
--- a/tests/tar.test
+++ b/tests/tar.test
@@ -59,6 +59,11 @@ skipnot id nobody >/dev/null
testing "pass group" "tar c --owner root --group nobody --mtime @0 file | LST" \
"-rw-rw-r-- root/nobody 0 1970-01-01 00:00 file\n" "" ""
+# Historically we output a "base 256" format that _we_ could decode but that
+# GNU tar choked on, so check the exact bytes with SUM, not a LST round trip.
+testing "huge values" "tar c --owner 9999999 --group 8888888 --mtime @0 file | SUM 3" \
+ "396b07fd2f80eeb312462e3bfb7dc1325dc6bcfb\n" "" ""
+
touch -t 198701231234.56 file
testing "pass mtime" \
"tar c --owner root --group root file | LST --full-time" \