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

lib: Verify mode values #315

Merged
merged 2 commits into from
Aug 19, 2024
Merged

Conversation

cgwalters
Copy link
Contributor

Today, lcfs_node_set_mode happily accepts any mode_t aka uint32 value and basically dumps it into the erofs inode. I accidentally stumbled over this when I forgot that a regular file needs S_IFREG in the mode bits in the dump file, but at least fsck.erofs does notice this.

@cgwalters
Copy link
Contributor Author

This will textually (but not logically) conflict with #314 due to dump file addition; let's merge that first.

@alexlarsson
Copy link
Collaborator

Hmm, this looks good, but seems to break the CI...

Today, `lcfs_node_set_mode` happily accepts any `mode_t` aka uint32
value and basically dumps it into the erofs inode. I accidentally
stumbled over this when I forgot that a regular file needs `S_IFREG`
in the mode bits in the dump file, but at least `fsck.erofs` does
notice this.

Signed-off-by: Colin Walters <[email protected]>
@cgwalters
Copy link
Contributor Author

Hmm, this looks good, but seems to break the CI...

OK yeah, we need to skip checking the mode for hardlinks as it's not meaningful; done.

@cgwalters cgwalters marked this pull request as ready for review August 19, 2024 15:01
We were writing to the sourcedir.

Signed-off-by: Colin Walters <[email protected]>
@cgwalters cgwalters merged commit 69508cb into containers:main Aug 19, 2024
24 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.

2 participants