From 9a29d612dd17554d566027ce564699fd371ac658 Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Sun, 30 Oct 2011 14:01:08 -0400 Subject: 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 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'debian/patches-applied') diff --git a/debian/patches-applied/update-motd b/debian/patches-applied/update-motd index 1018a296..b739c60a 100644 --- a/debian/patches-applied/update-motd +++ b/debian/patches-applied/update-motd @@ -6,10 +6,10 @@ Authors: Dustin Kirkland Upstream status: not yet submitted -Index: pam-debian/modules/pam_motd/pam_motd.c +Index: pam.ubuntu/modules/pam_motd/pam_motd.c =================================================================== ---- pam-debian.orig/modules/pam_motd/pam_motd.c 2011-10-10 16:21:50.998512220 -0700 -+++ pam-debian/modules/pam_motd/pam_motd.c 2011-10-13 11:35:02.921398033 -0700 +--- pam.ubuntu.orig/modules/pam_motd/pam_motd.c ++++ pam.ubuntu/modules/pam_motd/pam_motd.c @@ -48,14 +48,38 @@ static char default_motd[] = DEFAULT_MOTD; @@ -51,7 +51,7 @@ Index: pam-debian/modules/pam_motd/pam_motd.c if (flags & PAM_SILENT) { return retval; -@@ -80,34 +104,19 @@ +@@ -80,34 +104,21 @@ if (motd_path == NULL) motd_path = default_motd; @@ -80,8 +80,10 @@ Index: pam-debian/modules/pam_motd/pam_motd.c + 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)) { ++ 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"); ++ umask(old_mask); } - _pam_drop (mtmp); -- cgit v1.2.3