-
-
Notifications
You must be signed in to change notification settings - Fork 301
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
Add native PAM module #484
Conversation
Signed-off-by: MusiKid <musikid@outlook.com>
Thank you so much for this implementation! I tried writing this exact thing before but I'm just not good enough in C++, as you've probably read in one of the issues you've linked The blocking issue is an annoying one. I tried to figure out how fingerprint-gui managed to get that to work. The fingerprint PAM module accepts both a password or your fingerprint and authenthecates based on whatever it got first. Maybe the answer is burried in its (pretty hard to read) source? |
I read the FingerprintGui source code, and the method that it uses to circumvent the blocking issue is dirty... |
Waiting for the PAM implementation is going to take a long while though. Not only does it have to be coded and merged, it's going to take years to be reliably available on all the distros I really like the suggestion @X-Ryl669 posted in that thread though, could we write our own internal version of |
You are right about the time that it would take to wait before an implementation 😅️. |
Ah sorry, i misunderstood what you meant by blocking on the application-side in your first post. Very annoying that PAM has no way to make this work without a hack. Do you think it would be acceptable to implement the hacky workaround (sending a keypress from the Howdy python thread) as an experimental config option that is disabled by default? |
It's definitely possible, but it would require more work and also granting root access to the Python process because if we want to simulate a key press, we need to use |
I've done some small testing with the python |
PAM modules runs with root rights only if the application is setuid and the owner is set to root (see http://www.linux-pam.org/Linux-PAM-html/mwg-see-programming-sec.html). Even if it's uncommon and I am not aware of a real use case, it's possible to run a PAM module without root rights. You can test it easily with pamtester and |
Well, that solves the |
I think yes. The only problem now is how to communicate to PAM module that the Enter key was pressed by the comparator. I'm thinking about implementing it like FingerprintGui, which means using a pipe between Python and the module. |
We also need to think about how we should handle the failure of the face recognition. |
d4d5920
to
9f8e163
Compare
45a152f
to
13800c9
Compare
Signed-off-by: MusiKid <musikid@outlook.com>
Nice chart! |
Perhaps asking for the password in a new thread would avoid simulating enter press. Just cancel password prompt thread after howdy python process was returned. |
I'm confused... |
Thanks @ccat3z for the tip BTW! |
It seems to work only on some programs (only pamtester AFAIK). |
No such problem on my laptop. sudo/pkexec/gdm works without press enter key. |
Nevermind, it was just a stupid bug. Thanks a lot for the tip! |
This is amazing input @ccat3z! I think we're branding this as experimental anyway so if it does not work in some instances that's okay |
Signed-off-by: MusiKid <musikid@outlook.com>
After several days of daily use, I found that it is not always safe to cancel
|
Should I change the base branch for the |
Yes that would be perfect! The beta branch will be 3.0.0 in a future that's hopefully soon (next few months?) Thank you so much for all the hours you have put into this PR and the repo as a whole! |
howdy/src/compare.py
Outdated
]) | ||
|
||
|
||
# Make sure we were given an username to tast against |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Misspell] "tast" is a misspelling of "taste" (view)
Rule | Correct | Incorrect |
---|---|---|
taste |
taste | tast |
You can close this issue if no need to fix it. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think that's quite right...
Hmm, I should probably reverse the last commit and resolve the conflicts manually... |
I was able to resolve the conflicts and rebase against |
@musikid if that's the only solution then try it. This is force pushing your own branch right, not boltgolt/howdy? |
Yes, it will not touch it, of course! It's just that it will “pollute” a little more the log. |
Took 1,5 years but this is finally merged! Thanks so much to @musikid and all others in this thread |
This removes the dependency on python2(as mentioned in #535 ), right? Is there going to be a 3.0.0 release soon? |
I would like that too, but there is still work to be done on getting this out as a beta and after that we can do a general release, probably late summer? |
@muskid testing the beta release of 3.0.0 i'm getting this error in the PAM log:
Seems to be one symbol that's the issue:
You're more comfortable with the whole c++ part of it, how would i go about using no version higher than GLIBCXX_3.4.28 that's available on Ubuntu 20.04? |
This shouldn't cause any problem AFAIK. |
Welll it's a fatal error, so howdy does not start up at all because of that |
You also need to rebuild it against the lower version of libstdc++. If I understand correctly, since you target Ubuntu 20.04, then you need to build the module on it too. |
@musikid can we get a new release which includes this new awesome feature? |
The release is still in the works but should come out ASAP. |
do you need any help? |
Summary
This pull request introduces a native PAM module (written in C++) which waits for user input and asynchronously perform the face comparison.
Based on #9, I first tried to wait for the first event which responds, but since
pam_get_authtok
(the function which ask the user password) is blocking on the application-side, we have to wait for the user to fill the password and can't perform authentication on background.What approach should we use then?
Related
#99, #9, #478, #456