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

_ostree_ensure_fsverity: Properly check for errors #3227

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

alexlarsson
Copy link
Member

If fs_verity_wanted == _OSTREE_FEATURE_YES we should fail if !suported, but we were checking !supported where supported is a pointer, not a boolean. This caused us to miss errors when the kernel didn't support fs-verity that lead to lots of debugging.

If fs_verity_wanted == _OSTREE_FEATURE_YES we should fail if
!suported, but we were checking !supported where supported is a
pointer, not a boolean. This caused us to miss errors when the kernel
didn't support fs-verity that lead to lots of debugging.
Copy link
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

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

LGTM.

(Another one where Rust wouldn’t have let this happen)

@cgwalters cgwalters enabled auto-merge April 8, 2024 15:11
@ericcurtin
Copy link
Collaborator

Could be a good C/C++ compiler warning/error addition that you could turn on optionally, ensure pointers get checked against NULL in C or nullptr in C++ and that booleans get checked against true/false etc. For new C or C++ codebases to switch on from the start.

@ericcurtin
Copy link
Collaborator

Tagging @davidmalcolm in case it gives inspiration to a feature (although I'm sure this kinda check has been discussed many times before)

@ericcurtin
Copy link
Collaborator

I guess the header files from libraries might make these warnings difficult among other things 😅

@cgwalters cgwalters merged commit 3c2e9d0 into ostreedev:main Apr 8, 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.

3 participants