I spent the evening tracking down this bug. I am using AuthPAM with proftpd and pam_krb5. proftpd always segfaults after logout, and lastlog then tells the user has gone without logout. Great... :) Well, the problem is that proftpd does a chroot and then calls PAM_DELETE_CREDS. pam_krb5 tries to get the default krb5 realm and fails (because it can't access its config file due to chroot), the field is uninitialized, points into Nirvana and boom. I've attached a patch that explicitly sets it to "" (empty string, better than nothing) before getting the default realm so that at it doesn't crash anymore. Reproducible: Always Steps to Reproduce: 1. 2. 3.
Created attachment 41434 [details, diff] Workaround for pam_krb5 to not segfault when unable to get default realm (like in a chroot environment)
Created attachment 41435 [details, diff] Workaround for pam_krb5 to not segfault when unable to get default realm (like in a chroot environment) Sorry, wrong patch... this one is the working one.
Committed. Thanks