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

Change setuid Calls to setreuid, and the Same for setgid. #55

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ljtpetersen
Copy link

As described in section 8.1 of https://people.eecs.berkeley.edu/~daw/papers/setuid-usenix02.pdf, setuid should be avoided because of its inconsistent implementation across different unix systems. Instead, setreuid should be used, as it is more consistent across systems.

As well, in the execute function there was a small snipped of code that I couldn't see why it existed, so I refactored it slightly.

It could be worth looking into also forcing the chdir directory, to be in the chroot directory, if you are enabling a chroot. As well, then it would be possible to reliably set the PWD environment variable. The PWD environment variable is not changed by the chroot, although it is possible that the current working directory is.

As described in section 8.1 of https://people.eecs.berkeley.edu/~daw/papers/setuid-usenix02.pdf,
setuid should be avoided because of its inconsistent implementation across different unix systems. Instead,
setreuid should be used, as it is more consistent across systems.
daemonize/src/lib.rs Outdated Show resolved Hide resolved
Add a clippy allow statement and a comment to indicate why the cast is there.
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