This is awesome, by the way.
I had issues calling setuid() before setgid(). I think the reason is that only uid 0 can do either call. Maybe Linux is a little different, but on FreeBSD it's that way and it seems to make sense to me. I guess your tests should confirm the same thing? Unless this is a FreeBSD-only behavior, I should run it on my machine.
You can see that here:
https://github.com/teran-mckinney/raru/blob/master/raru.c#L36
I should probably make that comment a bit more obvious as it is kind of terse and easy to miss.
This is awesome, by the way.
I had issues calling
setuid()beforesetgid(). I think the reason is that only uid 0 can do either call. Maybe Linux is a little different, but on FreeBSD it's that way and it seems to make sense to me. I guess your tests should confirm the same thing? Unless this is a FreeBSD-only behavior, I should run it on my machine.You can see that here:
https://github.com/teran-mckinney/raru/blob/master/raru.c#L36
I should probably make that comment a bit more obvious as it is kind of terse and easy to miss.