system("/bin/sh") drops setuid bit in Ubuntu 16 and later
njfox opened this issue · 1 comments
njfox commented
https://unix.stackexchange.com/questions/519338/why-does-the-setuid-bit-work-inconsistently
After Ubuntu 14.04, bash
started dropping the setuid bit when the real user id and effective user id don't match. In order to get it to preserve the setuid bit, you have to pass -p
as an argument to bash
. I'm currently looking for a workaround but this hopefully only affects labs that use system(/bin/sh)
calls (lab2 for example)