then everything works as expected: both lightdm and unity lockscreen are accepting my password.
Without suid it seems that call (with correct username) to getspnam in function get_account_info in file passverify.c in pam/modules/pam_unix returns NULL. I don't understand this behaviour. I wrote a simple c program that calls getspnam and it works as expected when called from unprivileged user.
When unix_chkpwd (both suid root and not) is called by lightdm, then it always works good.
When I add suid root to unix_chkpwd binary:
chmod u+s /sbin/unix_chkpwd
then everything works as expected: both lightdm and unity lockscreen are accepting my password.
Without suid it seems that call (with correct username) to getspnam in function get_account_info in file passverify.c in pam/modules/ pam_unix returns NULL. I don't understand this behaviour. I wrote a simple c program that calls getspnam and it works as expected when called from unprivileged user.
When unix_chkpwd (both suid root and not) is called by lightdm, then it always works good.