From 73118592885eb3554eddb360d5f6ab65ee6e1c03 Mon Sep 17 00:00:00 2001 From: Balint Reczey Date: Tue, 17 Dec 2019 16:48:13 +0100 Subject: Return only PAM_IGNORE or error from pam_motd Follow-up for c81280b16e1831ab0bdd0383486c7e2d1eaf1b5e. * modules/pam_motd/pam_motd.c: Return PAM_IGNORE if pam_putenv succeeds. * modules/pam_motd/pam_motd.8.xml: Document additional possible return values of the module. --- modules/pam_motd/pam_motd.8.xml | 18 +++++++++++++++++- modules/pam_motd/pam_motd.c | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/modules/pam_motd/pam_motd.8.xml b/modules/pam_motd/pam_motd.8.xml index d939ad7e..b533530b 100644 --- a/modules/pam_motd/pam_motd.8.xml +++ b/modules/pam_motd/pam_motd.8.xml @@ -132,11 +132,27 @@ RETURN VALUES + + PAM_ABORT + + + Not all relevant data or options could be obtained. + + + + + PAM_BUF_ERR + + + Memory buffer error. + + + PAM_IGNORE - This is the only return value of this module. + This is the default return value of this module. diff --git a/modules/pam_motd/pam_motd.c b/modules/pam_motd/pam_motd.c index 51b0168b..f22cea3a 100644 --- a/modules/pam_motd/pam_motd.c +++ b/modules/pam_motd/pam_motd.c @@ -398,7 +398,7 @@ int pam_sm_open_session(pam_handle_t *pamh, int flags, retval = pam_putenv(pamh, "MOTD_SHOWN=pam"); - return retval; + return retval == PAM_SUCCESS ? PAM_IGNORE : retval; } /* end of module definition */ -- cgit v1.2.3