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

os/user: cannot pick up sss users in nocgo mode #27412

Closed
fmd opened this issue Aug 31, 2018 · 2 comments
Closed

os/user: cannot pick up sss users in nocgo mode #27412

fmd opened this issue Aug 31, 2018 · 2 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@fmd
Copy link

fmd commented Aug 31, 2018

What version of Go are you using (go version)?

go version go1.9.1 linux/amd64

Problem:

the os/user package has moved off of using cgo system commands to find users. On our system (and many others), there are several users that don't appear in /etc/passwd, but on the system we can see them fine with getent passwd <USER> (because sssd handles this).

So, as the os/user package uses only /etc/passwd to look for users, go doesn't have a way (as far as i know) to get all the users without using getent or id directly.

How can we make Go able to find all of the users like getent or id can?

@dominikh
Copy link
Member

the os/user package has moved off of using cgo system commands to find users

What makes you say that? Go still uses the libc for os/user, when building with cgo support enabled.

See for example https://github.com/golang/go/blob/master/src/os/user/cgo_lookup_unix.go.

@dominikh dominikh changed the title os/user cannot pick up sss users os/user: cannot pick up sss users Aug 31, 2018
@kevinburke
Copy link
Contributor

Maybe you are cross compiling binaries? IIRC that causes the library to use pure Go instead of cgo.

@FiloSottile FiloSottile changed the title os/user: cannot pick up sss users os/user: cannot pick up sss users in nocgo mode Aug 31, 2018
@FiloSottile FiloSottile added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 31, 2018
@FiloSottile FiloSottile added this to the Unplanned milestone Aug 31, 2018
@fmd fmd closed this as completed Sep 18, 2018
@golang golang locked and limited conversation to collaborators Sep 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants