From d0617dd77e6b3aaf2c9c3850f4c95fe6c06d39d0 Mon Sep 17 00:00:00 2001 From: Balint Reczey Date: Wed, 4 Dec 2019 11:56:16 +0100 Subject: [PATCH] pam_motd: Export MOTD_SHOWN=pam after showing MOTD LP: #1855092 --- ...rt-MOTD_SHOWN-pam-after-showing-MOTD.patch | 26 +++++++++++++++++++ debian/patches-applied/series | 1 + 2 files changed, 27 insertions(+) create mode 100644 debian/patches-applied/0001-pam_motd-Export-MOTD_SHOWN-pam-after-showing-MOTD.patch diff --git a/debian/patches-applied/0001-pam_motd-Export-MOTD_SHOWN-pam-after-showing-MOTD.patch b/debian/patches-applied/0001-pam_motd-Export-MOTD_SHOWN-pam-after-showing-MOTD.patch new file mode 100644 index 00000000..8dddb8a3 --- /dev/null +++ b/debian/patches-applied/0001-pam_motd-Export-MOTD_SHOWN-pam-after-showing-MOTD.patch @@ -0,0 +1,26 @@ +From: Balint Reczey +Date: Wed, 4 Dec 2019 11:48:45 +0100 +Subject: pam_motd: Export MOTD_SHOWN=pam after showing MOTD + +This is a useful indication for update-motd profile.d snippet which can +also try to show MOTD when it is not already shown. + +The use-case for that is showing MOTD in shells in containers without +PAM being involved. +--- + modules/pam_motd/pam_motd.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/modules/pam_motd/pam_motd.c b/modules/pam_motd/pam_motd.c +index cc828d7..192903d 100644 +--- a/modules/pam_motd/pam_motd.c ++++ b/modules/pam_motd/pam_motd.c +@@ -152,6 +152,8 @@ int pam_sm_open_session(pam_handle_t *pamh, int flags, + if (motd_dir_path != NULL) + try_to_display_directory(pamh, motd_dir_path); + ++ retval = pam_putenv(pamh, "MOTD_SHOWN=pam"); ++ + return retval; + } + diff --git a/debian/patches-applied/series b/debian/patches-applied/series index e6eaf6ff..7d3f10fa 100644 --- a/debian/patches-applied/series +++ b/debian/patches-applied/series @@ -28,3 +28,4 @@ pam_umask_usergroups_from_login.defs.patch extrausers.patch pam-limits-nofile-fd-setsize-cap fix-autoreconf.patch +0001-pam_motd-Export-MOTD_SHOWN-pam-after-showing-MOTD.patch -- 2.17.1