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

proposal: os/user: include shell in user lookup #59121

Open
kdrag0n opened this issue Mar 19, 2023 · 0 comments
Open

proposal: os/user: include shell in user lookup #59121

kdrag0n opened this issue Mar 19, 2023 · 0 comments
Labels
Milestone

Comments

@kdrag0n
Copy link

kdrag0n commented Mar 19, 2023

On unix systems, user.Lookup returns most passwd fields, but not shell:

u := &User{
Username: parts[0],
Uid: parts[2],
Gid: parts[3],
Name: parts[4],
HomeDir: parts[5],
}

It can be desired to look up a user's shell in some cases, and it should be a small non-intrusive change:

  • Add a Shell string field to user.User.
  • For the Cgo case, read pw_shell from the passwd struct
  • For the non-Cgo case, read parts[6]
  • Leave the field blank on Windows systems
@gopherbot gopherbot added this to the Proposal milestone Mar 19, 2023
@seankhliao seankhliao changed the title proposal: os/user: Include shell in user lookup proposal: os/user: include shell in user lookup May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Incoming
Development

No branches or pull requests

2 participants