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

Check installer permissions using geteuid #43

Open
rilysh opened this issue Sep 21, 2023 · 0 comments
Open

Check installer permissions using geteuid #43

rilysh opened this issue Sep 21, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@rilysh
Copy link

rilysh commented Sep 21, 2023

Hi!
I noticed EBPF doesn't correctly check the permission whether the user has root privilege or not. Instead, it relies on other functions' errors. (E.g. In libsysinternalsEBPFinstaller.c at line 279, it relies on mkdir(...) and stat(...) functions' success/errors). It would be better to just check the permission through geteuid(...) instead.

if (geteuid() != (uid_t)0) {
     // Error message
}

Something like this also fixes an issue where with the -u flag (uninstall), the installer (libsysinternalsEBPFinstaller.c) doesn't check the permission at all.

@MarioHewardt MarioHewardt added good first issue Good for newcomers enhancement New feature or request labels Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants