-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
setuid() syscall on Linux only sets uid of current thread #1337
Comments
Thanks for bringing this up. We definitely need to address it. Here's the relevant section from the man page:
However, In some cases zig std lib may choose to not implement a posix function, if it is deemed to be too buggy or problematic. This may be the case for setuid. I'll decide when I see the implementation, but "signals" is always a red flag. |
alternatively we could write a patch to Linux, and introduce a new syscall, perhaps We need setuid if we wan't to listen to privileged ports and then drop privileges, although this could be worked around by dropping privileges before spawning threads. (go can't do this) An alternate fix would be to make |
Related: #2380 |
we have to set up a signal handler in the other threads to call setuid() and setgid(), and then send the other threads a signal, like glibc does.
The text was updated successfully, but these errors were encountered: