Post #1805562
2026-04-30 11:12 UTC
@sitharus@cloudisland.nz I thought that the setuid syscall should be unnecessary since setuid binaries are executed with the effective user id of the owner so it seems redundant? but apparently not, when I removed that it didn't work anymore
if anyone knows why that is I would love an explanation
Replies (1)
-
@ewenmcneill@cloudisland.nz 2026-04-30 11:31
@gwen@tech.lgbt @sitharus@cloudisland.nz yes setuid binaries are executed with the *effective* uid of the owner of the file. But the real user ID is lurking in the background. Different things check those two uids. By calling the setuid syscall (which you can do with euid root) you can overwrite the real uid, and make real and euid both root (ie really the root user). (I forget exactly which step is the problem check on the real uid, but running the setuid syscall is the expected conventional flow here.)