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

Detect shell using /etc/password before falling back to bash #17

Open
spolu opened this issue May 16, 2017 · 4 comments
Open

Detect shell using /etc/password before falling back to bash #17

spolu opened this issue May 16, 2017 · 4 comments

Comments

@spolu
Copy link
Owner

spolu commented May 16, 2017

No description provided.

@bAndie91
Copy link

I recommend a more common way:

  • getenv(SHELL)
  • getpwuid()->pw_shell
  • /bin/sh

@spolu
Copy link
Owner Author

spolu commented Jun 15, 2017

@bAndie91 we do (1) and (3) indeed. We definitely want to implement (2). Do you know how portable is getpwuid()->pw_shell ?

@spolu
Copy link
Owner Author

spolu commented Jun 15, 2017

Is that accessible from the command line given that this is all written in Go?

@bAndie91
Copy link

According to manual, getpwuid is conforming to SVr4, 4.3BSD, POSIX.1-2001.
Second question is a bit obscure to me. you can call getpwuid by getent passwd shell command, but I don't know anything about golang binding of libc function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants