Repository navigation
Conversation
A layer normalizes what it captures, but a layer travels through Buck as a directory artifact, and Buck stores no mode beyond the executable bit. A layer materialized from the cache therefore has every directory in the mode the host's umask allows: 0775 under a developer's 0002, 0755 under CI's 0022. sshd refuses a group-writable /usr/share/empty.sshd, so an image built from cached layers on such a host boots without a working SSH server, while CI never sees it. finalize.image() restored /tmp's 1777 as the one mode a layer cannot carry, but left the rest to the layers. Normalize the whole mounted stack there, the last point before the image is written, and only chmod what differs so the overlay copies up nothing it need not. The sysext driver writes /opt and the extension-release after that point, so it normalizes what it creates. layer.py uses the shared function; its test moves to finalize_test.py.
Member
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have only lightly reviewed this, most is claude. I think this means we can also drop the special case for /tmp, /var/tmp but I leave that to you I wanted to be conservative here.
A layer normalizes what it captures, but a layer travels through Buck as a directory artifact, and Buck stores no mode beyond the executable bit. A layer materialized from the cache therefore has every directory in the mode the host's umask allows: 0775 under a developer's 0002, 0755 under CI's 0022. sshd refuses a group-writable /usr/share/empty.sshd, so an image built from cached layers on such a host boots without a working SSH server, while CI never sees it.
finalize.image() restored /tmp's 1777 as the one mode a layer cannot carry, but left the rest to the layers. Normalize the whole mounted stack there, the last point before the image is written, and only chmod what differs so the overlay copies up nothing it need not. The sysext driver writes /opt and the extension-release after that point, so it normalizes what it creates.
layer.py uses the shared function; its test moves to finalize_test.py.