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

Wrong check for username/password at line 408 of user.c #59

Closed
lilyfang opened this issue Aug 30, 2016 · 2 comments
Closed

Wrong check for username/password at line 408 of user.c #59

lilyfang opened this issue Aug 30, 2016 · 2 comments

Comments

@lilyfang
Copy link
Member

User.c has the logic to check the username/password. The check for the return value is wrong, thus it causes accidentally returning the last username/password when the username/password does not exist in the system.

@palladia
Copy link
Contributor

I tried to repro this several ways:

  1. Running gdb on omiserver, I set up breakpoint in LookupUser() in user.c, and invoked omicli using basic auth. If user name is not valid, this function never gets invoked, and omicli properly states that it's INVALID_ACCESS. If user name is correct, the function gets called, but getpwnam_r() seems to be invoked correctly.

So it looks like with new authentication code, bad user gets detected before LookupUser() is invoked, so this may not be an issue any more.

I verified this on Ubuntu 14.04 and CentOS 7.

  1. Just to make sure that getpwnam_r() is working properly, I wrote a small program to test just getpwnam_r(). On both Ubuntu 14.04 and CentOS 7, the getpwnam_r() returns correctly.

There are no details in descriptions what platform this problem was observed.

@yakman2020
Copy link
Contributor

fix

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

3 participants