pwent_mapper_find_user() searches through all available passwd db entries to find an user.  This takes a very long time, if you have many users (10000).  Additionally, if you have nss-ldap configured, it transfers a large amount of data (which is expensive on mobile connections...). 
pwent_mapper_find_user() searches through all available passwd db
entries to find an user.  This takes a very long time, if you have many
users (10000).  Additionally, if you have nss-ldap configured, it
transfers a large amount of data (which is expensive on mobile
connections...). 

Included you find a patch to speed up user finding for the pwent_mapper.
It first tries to find a user directly by calling getpwnam() with the
found CN. If this fails, the old mechanism is used.  (I think the second
step could probably even be removed: I can't find a situation where the
getpwnam() does not work.)

Please have a look at the patch. If it's OK please include it in further
pam_pkcs11 releases (so I don't have to patch every new pam_pkcs11
release on my own ;-) ).

Kind regards
Dominik Fischer

http://www.opensc-project.org/pipermail/opensc-devel/2011-March/016167.html


OpenSC/pam_pkcs11,milgner/pam_pkcs11,milgner/pam_pkcs11,milgner/pam_pkcs11,OpenSC/pam_pkcs11