From e574b31229426d7aa4e35ca9afbc2704e06cff5f Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Sun, 30 Oct 2011 14:01:43 -0400 Subject: debian/patches-applied/update-motd: new module option for pam_motd, 'noupdate', which suppresses the call to run-parts /etc/update-motd.d. LP: #805423. --- debian/changelog | 3 ++ debian/patches-applied/update-motd | 89 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 89 insertions(+), 3 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 7781898d..eb813b3d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,9 @@ pam (1.1.3-6) UNRELEASED; urgency=low * debian/patches-applied/update-motd: set a sane umask before calling run-parts, and restore the old mask afterwards, so /run/motd gets consistent permissions. LP: #871943. + * debian/patches-applied/update-motd: new module option for pam_motd, + 'noupdate', which suppresses the call to run-parts /etc/update-motd.d. + LP: #805423. -- Steve Langasek Sun, 30 Oct 2011 06:53:29 -0700 diff --git a/debian/patches-applied/update-motd b/debian/patches-applied/update-motd index b739c60a..3e89e114 100644 --- a/debian/patches-applied/update-motd +++ b/debian/patches-applied/update-motd @@ -10,7 +10,7 @@ Index: pam.ubuntu/modules/pam_motd/pam_motd.c =================================================================== --- pam.ubuntu.orig/modules/pam_motd/pam_motd.c +++ pam.ubuntu/modules/pam_motd/pam_motd.c -@@ -48,14 +48,38 @@ +@@ -48,14 +48,39 @@ static char default_motd[] = DEFAULT_MOTD; @@ -45,13 +45,24 @@ Index: pam.ubuntu/modules/pam_motd/pam_motd.c { int retval = PAM_IGNORE; - int fd; ++ int do_update = 1; const char *motd_path = NULL; - char *mtmp = NULL; + struct stat st; if (flags & PAM_SILENT) { return retval; -@@ -80,34 +104,21 @@ +@@ -73,6 +98,9 @@ + "motd= specification missing argument - ignored"); + } + } ++ else if (!strcmp(*argv,"noupdate")) { ++ do_update = 0; ++ } + else + pam_syslog(pamh, LOG_ERR, "unknown option: %s", *argv); + } +@@ -80,34 +108,23 @@ if (motd_path == NULL) motd_path = default_motd; @@ -79,7 +90,9 @@ Index: pam.ubuntu/modules/pam_motd/pam_motd.c + If /etc/motd -> /var/run/motd, the displayed MOTD will be dynamic. + Otherwise, the admin can force a static MOTD by breaking that symlink + and publishing into an /etc/motd text file. */ -+ if ((stat("/etc/update-motd.d", &st) == 0) && S_ISDIR(st.st_mode)) { ++ if (do_update && (stat("/etc/update-motd.d", &st) == 0) ++ && S_ISDIR(st.st_mode)) ++ { + mode_t old_mask = umask(0022); + if (!system("/usr/bin/env -i PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin run-parts --lsbsysinit /etc/update-motd.d > /var/run/motd.new")) + rename("/var/run/motd.new", "/var/run/motd"); @@ -98,3 +111,73 @@ Index: pam.ubuntu/modules/pam_motd/pam_motd.c } +Index: pam.ubuntu/modules/pam_motd/pam_motd.8.xml +=================================================================== +--- pam.ubuntu.orig/modules/pam_motd/pam_motd.8.xml ++++ pam.ubuntu/modules/pam_motd/pam_motd.8.xml +@@ -52,6 +52,17 @@ + + + ++ ++ ++ ++ ++ ++ ++ Don't run the scripts in /etc/update-motd.d ++ to refresh the motd file. ++ ++ ++ + + + +Index: pam.ubuntu/modules/pam_motd/pam_motd.8 +=================================================================== +--- pam.ubuntu.orig/modules/pam_motd/pam_motd.8 ++++ pam.ubuntu/modules/pam_motd/pam_motd.8 +@@ -2,12 +2,12 @@ + .\" Title: pam_motd + .\" Author: [see the "AUTHOR" section] + .\" Generator: DocBook XSL Stylesheets v1.75.2 +-.\" Date: 06/04/2011 ++.\" Date: 10/30/2011 + .\" Manual: Linux-PAM Manual + .\" Source: Linux-PAM Manual + .\" Language: English + .\" +-.TH "PAM_MOTD" "8" "06/04/2011" "Linux-PAM Manual" "Linux\-PAM Manual" ++.TH "PAM_MOTD" "8" "10/30/2011" "Linux-PAM Manual" "Linux\-PAM Manual" + .\" ----------------------------------------------------------------- + .\" * Define some portability stuff + .\" ----------------------------------------------------------------- +@@ -45,6 +45,13 @@ + /path/filename + file is displayed as message of the day\&. + .RE ++.PP ++\fBnoupdate\fR ++.RS 4 ++Don\*(Aqt run the scripts in ++/etc/update\-motd\&.d ++to refresh the motd file\&. ++.RE + .SH "MODULE TYPES PROVIDED" + .PP + Only the +Index: pam.ubuntu/modules/pam_motd/README +=================================================================== +--- pam.ubuntu.orig/modules/pam_motd/README ++++ pam.ubuntu/modules/pam_motd/README +@@ -14,6 +14,10 @@ + + The /path/filename file is displayed as message of the day. + ++noupdate ++ ++ Don't run the scripts in /etc/update-motd.d to refresh the motd file. ++ + EXAMPLES + + The suggested usage for /etc/pam.d/login is: -- cgit v1.2.3