diff --git a/src/login.c b/src/login.c index e11b2758..79517f8a 100644 --- a/src/login.c +++ b/src/login.c @@ -1288,6 +1288,7 @@ int main (int argc, char **argv) env++; } } + (void) pam_end (pamh, PAM_SUCCESS | PAM_DATA_SILENT); #endif (void) setlocale (LC_ALL, ""); diff --git a/src/su.c b/src/su.c index bbf6d8e2..02c5b0be 100644 --- a/src/su.c +++ b/src/su.c @@ -1162,12 +1162,9 @@ int main (int argc, char **argv) } } - /* - * PAM_DATA_SILENT is not supported by some modules, and - * there is no strong need to clean up the process space's - * memory since we will either call exec or exit. - pam_end (pamh, PAM_SUCCESS | PAM_DATA_SILENT); - */ +#ifdef USE_PAM + (void) pam_end (pamh, PAM_SUCCESS | PAM_DATA_SILENT); +#endif endpwent (); endspent ();