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

get_username() reads file /etc/passwd to get user name. #15

Closed
kenjo opened this issue Sep 29, 2019 · 3 comments
Closed

get_username() reads file /etc/passwd to get user name. #15

kenjo opened this issue Sep 29, 2019 · 3 comments

Comments

@kenjo
Copy link

kenjo commented Sep 29, 2019

its actually get_user_id_from_username() doing it

This is not working on system using NIS or LDAP or any other system that has the user information not in the /etc/passwd file. The user do not exist and the string in empty then mainline is trying to open/use the cache in / instead of in ~/ the home directory of the user.

you have to use the glibc function getpwuid() getpwnam() for this to work correctly on all linux systems.

@ghost
Copy link

ghost commented Sep 29, 2019

Thanks I'll look into it. I'm away on vacation for a few more days so maybe not immediately.

@LucasChollet
Copy link

This can be closed as solved by d7943e5.

@kenjo
Copy link
Author

kenjo commented Feb 9, 2023

yes that commit looks like it fixes this issue.

@kenjo kenjo closed this as completed Feb 9, 2023
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