Last active
January 9, 2026 01:08
-
-
Save tianon/d7b3fc1dcd6eaf84390f6ea479d67f4e to your computer and use it in GitHub Desktop.
BAD TARBALLS (inspired by and including https://github.com/opencontainers/image-spec/issues/1301) -- see https://oci.dag.dev/?repo=tianon/test (tags starting with "badtars")
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| oci/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -Eeuo pipefail -x | |
| for go in *.go; do | |
| go run "$go" > "${go%.go}.tar" | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "archive/tar" | |
| "os" | |
| ) | |
| func main() { | |
| contents := []byte(`BAD TARBALL (to the tune of "BAD ROBOT")` + "\n\n") | |
| for i := 0; i < 10; i++ { | |
| tw := tar.NewWriter(os.Stdout) | |
| if err := tw.WriteHeader(&tar.Header{Name: "duplicate", Size: int64(len(contents))}); err != nil { | |
| panic(err) | |
| } | |
| if _, err := tw.Write(contents); err != nil { | |
| panic(err) | |
| } | |
| if err := tw.Flush(); err != nil { | |
| panic(err) | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| duplicate 0000000 0000000 0000000 00000000052 00000000000 011061 0 ustar 00 0000000 0000000 BAD TARBALL (to the tune of "BAD ROBOT") | |