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

fix correcting timestamps for created destination dir after copy #214

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

tonistiigi
Copy link
Owner

fixes #207

@smira

Copy link

@smira smira left a comment

Choose a reason for hiding this comment

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

thank you for the fix!

return err
} else {
defer fixCreatedParentDirs(createdDirs, ci.Utime)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Related to docker/buildx#2745 (comment), could we apply ownership as well?:

Suggested change
defer fixCreatedParentDirs(createdDirs, ci.Utime)
defer fixCreatedParentDirs(createdDirs, ci.Chown, ci.Utime)

Copy link
Owner Author

Choose a reason for hiding this comment

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

The issue is that although target directories are created with requested timestamp, when files are written into them it changes the modified time. So the modified time needs to be reset again after the copy. This problem does not exist for chown.

There is another weird case in this code where target dirs are always created with default 755 mode, even if --chmod is set. Not sure if this is correct, but not directly part of this issue.

@tonistiigi tonistiigi merged commit 397af53 into master Oct 28, 2024
19 checks passed
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.

copying a file with a tree path doesn't set timestamps correctly
3 participants