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

clang: fail when the kheaders ownership is wrong (#4928) #4985

Merged
merged 1 commit into from
May 17, 2024

Conversation

jeromemarchand
Copy link
Contributor

file_exists_and_ownedby() returns -1 when the file exists but its ownership is unexpected, which is very misleading since anything non zero is interpreted as true and a function with such a name is expected to return a boolean. So currently all this does, is write a warning message, and continues as if nothing is wrong.

Make file_exists_and_ownedby() returns false when the ownership is wrong and have get_proc_kheaders() fails when this happen. Also have all the exists functions return bool to avoid such issues in the future.

file_exists_and_ownedby() returns -1 when the file exists but its
ownership is unexpected, which is very misleading since anything non
zero is interpreted as true and a function with such a name is
expected to return a boolean. So currently all this does, is write a
warning message, and continues as if nothing is wrong.

Make file_exists_and_ownedby() returns false when the ownership is
wrong and have get_proc_kheaders() fails when this happen. Also have
all the *exists* functions return bool to avoid such issues in the
future.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
@jeromemarchand
Copy link
Contributor Author

I rebased my PR to pass the checks. Failures look related to an outdated libbpf which have been synced since I submitted the PR.

@yonghong-song yonghong-song merged commit 5bc97bb into iovisor:master May 17, 2024
12 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.

None yet

2 participants