-
Notifications
You must be signed in to change notification settings - Fork 3
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
tcb_(un)convert: Check for UID and EUID to be 0 before proceeding. #32
tcb_(un)convert: Check for UID and EUID to be 0 before proceeding. #32
Conversation
Why do this instead of keeping mode 700? Also, I'd write "proceeding" in place of "performing". |
237815f
to
bc50e3f
Compare
Technically I think this the safer approach, than relying on filesystem modes.
Fixed. |
I think the code should be checking
This depends on context. Each distro relies on filesystem modes for a lot of things anyway. So within a distro we control, relying on the modes may actually be safer. Also with the 700 file modes these programs are normally excluded from the shell's tab completion when working as a user. I think this is good. Overall, I'm not convinced this PR is an improvement, but I suppose it could fit some distros' packaging guidelines better, and is also defense against sloppy packaging. So I don't mind. As an option, we could add the code checks to support different distros' packaging conventions, but keep our mode 700 defaults (which packages may override). |
bc50e3f
to
5777b93
Compare
Well,
Reverted. |
Do we seriously want to defend against such misconfiguration? Most programs in the system would be dangerous if installed SUID or the like.
Yet it is technically possible to have So I think it is reasonable that we either don't make these changes at all (don't merge this PR) or require We could also check what precedent there is - how do other sysadmin tools that require to be run by root handle this? |
Ensuring the program is run with root privileges on startup is the safer approach instead on relying that mode 0700 may prevent the tool being run by a regular system user. Signed-off-by: Björn Esser <[email protected]>
5777b93
to
e789235
Compare
Fixed.
Some tools do it the same way, others check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this extra check would break anything.
Ensuring the program is run with root privileges on startup is the safer approach instead on relying that mode 0700 may prevent the tool being run by a regular system user.