Skip to content

lib: Verify mode values#315

Merged
cgwalters merged 2 commits intocomposefs:mainfrom
cgwalters:detect-invalid-mode
Aug 19, 2024
Merged

lib: Verify mode values#315
cgwalters merged 2 commits intocomposefs:mainfrom
cgwalters:detect-invalid-mode

Conversation

@cgwalters
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@alexlarsson
Copy link
Copy Markdown
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 <walters@verbum.org>
@cgwalters cgwalters force-pushed the detect-invalid-mode branch from 778de61 to 9fa7dab Compare August 19, 2024 14:53
@cgwalters
Copy link
Copy Markdown
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 <walters@verbum.org>
@cgwalters cgwalters merged commit 69508cb into composefs:main Aug 19, 2024
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