I made a golang progam expecting to start a new process and execute a command as root using sudo. When mapping UID/GIDs whenevr I specify syscall.CLONE_NEWUSER in the SysProcAttr the program errors out and informs me fork/exec /usr/bin/sudo: invalid argument but the command outputs the expected result, but does not use sudo. When run without syscall.CLONE_NEWUSER the program hangs indefinitely.
no errors, and the comand intended executed using sudo.
What did you see instead?
error fork/exec /usr/bin/sudo: invalid argument
The text was updated successfully, but these errors were encountered:
cdoern
changed the title
syscall.CLONE_NEWUSER causes invalid arg for every executable
syscall/execCommand: syscall.CLONE_NEWUSER causes invalid arg for every executable
Oct 10, 2021
toothrot
changed the title
syscall/execCommand: syscall.CLONE_NEWUSER causes invalid arg for every executable
syscall: syscall.CLONE_NEWUSER causes invalid arg for every executable
Oct 12, 2021
I don't believe this is a bug in Go or the standard library. A better place to ask this kind of question is golang-nuts. See https://golang.org/wiki/Questions.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?linux/amd64
go env
OutputWhat did you do?
I made a golang progam expecting to start a new process and execute a command as root using sudo. When mapping UID/GIDs whenevr I specify
syscall.CLONE_NEWUSER
in theSysProcAttr
the program errors out and informs mefork/exec /usr/bin/sudo: invalid argument
but the command outputs the expected result, but does not use sudo. When run withoutsyscall.CLONE_NEWUSER
the program hangs indefinitely.here is my code snipped (run as user not as root)
What did you expect to see?
no errors, and the comand intended executed using sudo.
What did you see instead?
error
fork/exec /usr/bin/sudo: invalid argument
The text was updated successfully, but these errors were encountered: