Skip to content

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.
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