This repository has been archived by the owner. It is now read-only.
Calls to getpwuid() with an unknown UID fail with ENOENT #1466
Comments
Thanks! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Issue Report
Bug
When calling
getpwuid()
with an unknown UID, it fails withENOENT
because the file at/var/lib/sss/mc/passwd
doesn't exist.CoreOS Version
Environment
I've tested this on an EC2 instance as well as a Packet server.
Expected Behavior
I would expect my call to
getpwuid()
with an unknown UID to return an errno of 0, with a NULL resulting object because the user is not found.Actual Behavior
Calling
getpwuid()
with an unknown UID returns anENOENT
when trying to look up the user in/var/lib/sss/mc/passwd
after failing to find the user in/etc/passwd
.Reproduction Steps
I've created a small Go program that pulls the code from the
os.user
package.You can view it here: https://gist.github.com/jirwin/608abc7f2bd64a78fe8fcfae83199bcc#file-main-go. It hardcodes a UID didn't exist on my server. Ensure it is run with a UID that doesn't exist to replicate the error.
Other Information
I've included the strace output of running the above program: https://gist.github.com/jirwin/608abc7f2bd64a78fe8fcfae83199bcc#file-strace-main
I'm fuzzy on what version I've seen this work as expected on before. I'd like to ballpark it around version 1032.1.0. My guess is that the introduction of
sssd
in 1045.0.0 is the cause of this change in behavior.The text was updated successfully, but these errors were encountered: