Skip to content

fix: truncate an existing destination in make_targz - #262

Open
Shubham-Padkonde wants to merge 1 commit into
oras-project:mainfrom
Shubham-Padkonde:fix/make-targz-truncate-existing
Open

Shubham-Padkonde wants to merge 1 commit into
oras-project:mainfrom
Shubham-Padkonde:fix/make-targz-truncate-existing

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown
Contributor

make_targz opened dest_name with O_WRONLY | O_CREAT but without O_TRUNC, so when the destination already existed and was larger than the new archive, its old trailing bytes were left after the gzip stream. The result had a different digest than a fresh archive and failed to decompress (gzip.BadGzipFile: Not a gzipped file).

make_targz opened dest_name with O_WRONLY | O_CREAT but without
O_TRUNC, so when the destination already existed and was larger than
the new archive, its old trailing bytes were left after the gzip stream.
The result had a different digest than a fresh archive and failed to
decompress (gzip.BadGzipFile: Not a gzipped file).

Signed-off-by: Shubham Padkonde <shubhampadkonde12@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant