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

Shows last user instead of un-associated uid #8

Closed
JaredNeil opened this issue Oct 31, 2019 · 1 comment
Closed

Shows last user instead of un-associated uid #8

JaredNeil opened this issue Oct 31, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@JaredNeil
Copy link
Contributor

If a process is running with an un-associated uid (like 9999), the User field for that process will show the username for the last user instead of displaying the uid directly.

ps:

$ ps -o pid,user 2872
  PID USER
 2872 9999

htop:

  PID USER
 2872 9999

bb:

  PID  PPID    USER
 2872  2843  hbrown
$ tail -n 1 /etc/passwd
hbrown:x:6543:6543:<omitted>
@epilys
Copy link
Owner

epilys commented Oct 31, 2019

This seems to be the default behavior of the getpwuid(3) functions in glibc, weird. We can see what ps is doing to fetch the usernames and follow that.

@epilys epilys added the bug Something isn't working label Oct 31, 2019
JaredNeil added a commit to JaredNeil/bb that referenced this issue Oct 31, 2019
@epilys epilys closed this as completed in 7663fbe Nov 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants