fix: set sticky bit on the default directory - #1317
Open
HeRaNO wants to merge 1 commit into
Open
Conversation
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.
Describe your changes.
make lint && make test.Fixes #1170.
/var/lib/pebble/defaultis intentionally world-writable so that Pebble can create its socket and state files when a rock uses a non-rootrun-user. However, mode0777allows users to remove or rename entries owned by other users and is reported by insecure world-writable-directory checks.Set the directory mode to
01777, preserving non-root write access while protecting directory entries with the sticky bit.The mode is updated in both paths that create the directory:
Tests now verify the complete mode with
stat.S_IMODEinstead of inspecting only the final three octal digits. Spread coverage checks the resulting image both with and without a generated Pebble layer, while retaining the existing non-root file-creation check.After this is released, affected base images must be rebuilt and republished; the change cannot alter permissions in already-published OCI layers.