Bug 66919 - pam_krb5 segfaults on logout when used in proftpd
Bug#: 66919 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: minor Priority: P2
Resolution: FIXED Assigned To: rphillips@gentoo.org Reported By: christophe@saout.de
Component: Applications
URL: 
Summary: pam_krb5 segfaults on logout when used in proftpd
Keywords:  
Status Whiteboard: 
Opened: 2004-10-09 13:56 0000
Description:   Opened: 2004-10-09 13:56 0000
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.

------- Comment #1 From Christophe Saout 2004-10-09 14:07:08 0000 -------
Created an attachment (id=41434) [details]
Workaround for pam_krb5 to not segfault when unable to get default realm (like
in a chroot environment)

------- Comment #2 From Christophe Saout 2004-10-09 14:08:24 0000 -------
Created an attachment (id=41435) [details]
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.

------- Comment #3 From Ryan Phillips (RETIRED) 2005-06-30 15:53:31 0000 -------
Committed. Thanks