fix for #17, setting PAM_TTY helps root

--HG--
extra : convert_revision : svn%3Aeebe1cee-a9af-4fe4-bd26-ad572b19c5ab/trunk%4087
This commit is contained in:
mathias.gumz 2009-02-24 21:09:24 +00:00
parent 3a17f9f123
commit 73882e869e
2 changed files with 5 additions and 0 deletions

View file

@ -1,5 +1,8 @@
Version 1.0
----------------------------------------------------------------------
2009-02-24:
* fix for #17, setting PAM_TTY helps root
2008-11-04:
* fix for #13, problems with 'make install' when asciidoc is not
installed and thus creates no 'alock.1'

View file

@ -161,6 +161,8 @@ static int alock_auth_pam_auth(const char* pass) {
PAM_password = pass;
pam_error = pam_start("login", PAM_username, &PAM_conversation, &pam_handle);
PAM_YN;
pam_error = pam_set_item(pam_handle, PAM_TTY, ttyname(0));
PAM_YN;
pam_error = pam_authenticate(pam_handle, 0);
PAM_YN;
pam_error = pam_end(pam_handle, pam_error);