Index: pam_mount-1.25/src/pam_mount.c =================================================================== --- pam_mount-1.25.orig/src/pam_mount.c +++ pam_mount-1.25/src/pam_mount.c @@ -445,7 +445,7 @@ PAM_EXTERN EXPORT_SYMBOL int pam_sm_open { struct vol *vol; int ret; - unsigned int krb5_set; + char *krb5; char *system_authtok = NULL; const void *tmp; int getval; @@ -461,8 +461,9 @@ PAM_EXTERN EXPORT_SYMBOL int pam_sm_open * Get the Kerberos CCNAME so we can make it available to the * mount command later on. */ - krb5_set = getenv("KRB5CCNAME") != NULL; - if (setenv("KRB5CCNAME", pam_getenv(pamh, "KRB5CCNAME"), 1) < 0) + krb5 = pam_getenv(pamh, "KRB5CCNAME"); + if (krb5 != NULL && + setenv("KRB5CCNAME", krb5, 1) < 0) l0g("KRB5CCNAME setenv failed\n"); /* Store initialized config as PAM data */ @@ -539,7 +540,7 @@ PAM_EXTERN EXPORT_SYMBOL int pam_sm_open } } memset(system_authtok, 0, strlen(system_authtok)); - if (krb5_set) + if (krb5 != NULL) unsetenv("KRB5CCNAME"); modify_pm_count(&Config, Config.user, "1"); envpath_restore();