[SRU] Please set MOTD_SHOWN=pam when MOTD was shown

Bug #1855092 reported by Balint Reczey
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pam (Ubuntu)
Fix Released
Undecided
Balint Reczey
Eoan
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

  * Users of containers may never see the MOTD of the container if they are always to the container's shell without PAM being involved.
  * MOTD contains important information about the system's health including the security updates to be installed thus it is desired to show MOTD in container shells, too.
  * The fix in update-motd is creating a snippet in /etc/profile.d which shows MOTD, but only if UPDATE_MOTD is not set, to avoid printing MOTD twice.

[Test Case]

 * Log in to the system, where PAM prints the MOTD.
 * After seeing the MOTD observe MOTD_SHOWN set:
   $ echo $MOTD_SHOWN
   pam
   $

[Regression Potential]

 * The fix is simple thus it is unlikely to see any regression due to bad implementation.
 * The newly set environment variable may interact with existing software, but this variable seems to be not used:
 https://codesearch.debian.net/search?q=MOTD_SHOWN&literal=1
 * With this change pam_motd module starts reporting errors and, most of the time, success. This is being refined at upstream to not report success, just PAM_IGNORE and errors: https://github.com/linux-pam/linux-pam/pull/157 . The behaviour change should not cause any issue on real-life systems since the return value of pam_motd is not used by default nor can we expect any configuration using it since it always returned PAM_IGNORE:

$ grep -A1 -B5 pam_motd /etc/pam.d/login

# Prints the message of the day upon successful login.
# (Replaces the `MOTD_FILE' option in login.defs)
# This includes a dynamically generated part from /run/motd.dynamic
# and a static (admin-editable) part from /etc/motd.
session optional pam_motd.so motd=/run/motd.dynamic
session optional pam_motd.so noupdate

However, I plan reverting the behaviour change in the follow-up upload (LP: #1856703) right after it is finalized at upstream. I propose releasing this change in the current form to Eoan, because it is needed by the update-motd SRU and the ubuntu-meta SRU that enables printing MOTD in the Eoan Ubuntu WSL instances.

Balint Reczey (rbalint)
Changed in pam (Ubuntu):
assignee: nobody → Balint Reczey (rbalint)
status: New → In Progress
Revision history for this message
Balint Reczey (rbalint) wrote :
Revision history for this message
Balint Reczey (rbalint) wrote :
Balint Reczey (rbalint)
description: updated
tags: added: patch
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Balint, or anyone else affected,

Accepted pam into eoan-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/pam/1.3.1-5ubuntu1.19.10.0 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-eoan to verification-done-eoan. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-eoan. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in pam (Ubuntu Eoan):
status: New → Fix Committed
tags: added: verification-needed verification-needed-eoan
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (pam/1.3.1-5ubuntu1.19.10.0)

All autopkgtests for the newly accepted pam (1.3.1-5ubuntu1.19.10.0) for eoan have finished running.
The following regressions have been reported in tests triggered by the package:

systemd/unknown (armhf)
lxc/3.0.4-0ubuntu1 (ppc64el)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/eoan/update_excuses.html#pam

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Balint Reczey (rbalint)
tags: added: wsl
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pam - 1.3.1-5ubuntu3

---------------
pam (1.3.1-5ubuntu3) focal; urgency=medium

  * Fix patches to fix FTBFS

 -- Balint Reczey <email address hidden> Thu, 05 Dec 2019 13:18:35 +0100

Changed in pam (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Balint Reczey (rbalint) wrote :

root@ee-motd-verify:~# login ubuntu
Password:
Welcome to Ubuntu 19.10 (GNU/Linux 5.0.0-37-generic x86_64)

 * Documentation: https://help.ubuntu.com
 * Management: https://landscape.canonical.com
 * Support: https://ubuntu.com/advantage

  System information as of Mon Dec 16 14:37:28 UTC 2019

  System load: 0.7 Processes: 28
  Usage of /home: unknown Users logged in: 0
  Memory usage: 0% IP address for eth0: 10.84.73.58
  Swap usage: 38%

0 updates can be installed immediately.
0 of these updates are security updates.

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

ubuntu@ee-motd-verify:~$ echo $MOTD_SHOWN
pam
ubuntu@ee-motd-verify:~$ dpkg -l libpam-modules | cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-====================-======================-============-========================================
ii libpam-modules:amd64 1.3.1-5ubuntu1.19.10.0 amd64 Pluggable Authentication Modules for PAM

tags: added: verification-done verification-done-eoan
removed: verification-needed verification-needed-eoan
Balint Reczey (rbalint)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pam - 1.3.1-5ubuntu1.19.10.0

---------------
pam (1.3.1-5ubuntu1.19.10.0) eoan; urgency=medium

  * pam_motd: Export MOTD_SHOWN=pam after showing MOTD (LP: #1855092)

 -- Balint Reczey <email address hidden> Wed, 04 Dec 2019 12:23:57 +0100

Changed in pam (Ubuntu Eoan):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for pam has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

tags: added: id-5d78fc6cca6d1b77a77952cc
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.