Skip to content
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

x/sys/unix: support Setuid/Setgid (...) syscalls on Linux #53444

Closed
mateusz834 opened this issue Jun 18, 2022 · 3 comments
Closed

x/sys/unix: support Setuid/Setgid (...) syscalls on Linux #53444

mateusz834 opened this issue Jun 18, 2022 · 3 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@mateusz834
Copy link
Member

Go 1.16 added support for Setuid/Setgid (and other uid/gid related syscalls), instead of returning the EOPNOTSUPP error.
But the x/sys/unix still returns EOPNOTSUPP.

Proposal: uid/gid related syscalls might just call their counterparts in the syscall package (when golang 1.16 or higher (build tags)) and return EOPNOTSUPP (when golang 1.15 and lower)

@gopherbot gopherbot added this to the Proposal milestone Jun 18, 2022
@mateusz834
Copy link
Member Author

mateusz834 commented Jun 18, 2022

Or it might make sense to just add a normal syscall invocation (not on all threads). It could be useful to have 2 different implementations. The x/sys/unix with the help of runtime.LockOSThread() would change uid only on one goroutine/thread. So it will allow to drop/gain privileges per thread.
Even unix.Setresuid, unix.Setreuid (...) are still working on per-thread basis, without returning EOPNOTSUPP.

@ianlancetaylor
Copy link
Contributor

Thanks, I don't think this needs to be a proposal. We should just make the unix versions call the syscall versions on Linux.

@ianlancetaylor ianlancetaylor changed the title proposal: x/sys/unix: support Setuid/Setgid (...) syscalls x/sys/unix: support Setuid/Setgid (...) syscalls on Linux Jun 19, 2022
@ianlancetaylor ianlancetaylor added NeedsFix The path to resolution is known, but the work has not been done. and removed Proposal labels Jun 19, 2022
@ianlancetaylor ianlancetaylor modified the milestones: Proposal, Unreleased Jun 19, 2022
@gopherbot
Copy link

Change https://go.dev/cl/428174 mentions this issue: unix: support all Setuid/Setgid and related syscalls

@golang golang locked and limited conversation to collaborators Sep 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants