-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: TestSUID prompts for password #60690
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
Comments
Which version of openbsd is this? The test seems to pass in our builders, which seem to be 7.2. |
|
(attn @golang/openbsd) |
If I had to guess, the builder user might not be a member of the wheel group like I am, so the |
We use Seemingly OpenBSD su is not doing this, and for some reason we aren't hitting the timeout on the context. For the former, we might just want to remap stdin to a reader which just returns a single null byte or something, which should (hopefully) always cause su/sudo to fail, for the later I have no clue what is happening, might be an exec issue? |
On various platforms we have had trouble with prompts that bypass See previously: |
OpenBSD |
|
https://github.com/openbsd/src/blob/master/libexec/login_passwd/login_passwd.c is the source for login_passwd that is being spawned to handle the authentication task. |
Looks like su is being killed after the 5s timeout, but the
|
I'm not sure the exact reasons why, but replacing |
This is extremely useful context, thanks! CombinedOutput actually sets the Stdout and Stderr to buffers, which I think overrides the default pipe behavior of Run, which might be triggering this issue (although that sounds extremely weird on the face to me), but who knows. I'll take a look at this tomorrow and see if I can come up with a more robust solution that what we have now. |
Interestingly, no hang with this diff. It did leave the login_passwd process running in the background until I typed another character at the shell, though.
|
That almost certainly doesn't fix the process leak — it just masks it (because the child process inherits raw FDs instead of the parent process starting copying goroutines). It looks like at least Linux and OpenBSD |
|
this works, no hang and it doesn't have to wait the 5s timeout either.
|
@jrick, want to send a CL for your above patch? |
Change https://go.dev/cl/502575 mentions this issue: |
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
)?go env
OutputWhat did you do?
Built latest Go 1.20.5 from source, running
bash all.bash
. I saw a password prompt during the tests, and narrowed it down to theruntime
testTestSUID
.What did you expect to see?
Passing tests as an unprivileged user. If privilege escalation is not possible, the test should be skipped.
What did you see instead?
The test eventually times out after the default 10m deadline.
The text was updated successfully, but these errors were encountered: