Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid zero-mtime files #250

Merged
merged 1 commit into from May 27, 2021
Merged

Avoid zero-mtime files #250

merged 1 commit into from May 27, 2021

Conversation

alexcrichton
Copy link
Owner

With rust-lang/cargo#9512 discovered this is, uh, odd fallout of the
"deterministic" header mode in this crate. This is an unintended
consequence of the deterministic header mode which should ideally be
fixable. This commit changes the tar crate to use a different constant
than 0 when creating archives with the deterministic header mode
(specifically 123456789: Nov 29, 1973). It also will now refuse to
create files with a 0 mtime, instead resetting the mtime to 1 which
should help the mtime be nonzero so tools like lldb don't accidentally
think it's zero.

With rust-lang/cargo#9512 discovered this is, uh, odd fallout of the
"deterministic" header mode in this crate. This is an unintended
consequence of the deterministic header mode which should ideally be
fixable. This commit changes the `tar` crate to use a different constant
than 0 when creating archives with the deterministic header mode
(specifically 123456789: Nov 29, 1973). It also will now refuse to
create files with a 0 mtime, instead resetting the mtime to 1 which
should help the mtime be nonzero so tools like lldb don't accidentally
think it's zero.
Copy link

@ehuss ehuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me. Until we run into a tool that is confused by an mtime of 1 😉 .

@alexcrichton alexcrichton merged commit e81f172 into master May 27, 2021
@alexcrichton alexcrichton deleted the zero-mtime branch May 27, 2021 19:47
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.

None yet

2 participants