Package: login
Version: 1:4.1.5-1
Severity: normal
Tags: patch

Separation of static and dynamic motd components
================================================

Currently initscripts generates the motd, and stores it in
/var/run/motd.  /etc/motd is a symlink to this file, and
/etc/motd.tail contains the static user-editable part.  This is not
ideal for a number of reasons, including /etc/motd not being a file as
documented, and not behaving like a conffile, and being generally
complex and confusing.  It also unnecessarily wastes space on /run.

In a future upload of initscripts, this will be simplified:

- /etc/motd will contain the user-editable part, and will be a regular
  file; /etc/motd.tail will be migrated here.
- The dynamic part (uname -a) will be stored in /run/motd.dynamic;
  this will be generated at boot like we do now.  There is scope for
  supporting other dynamically generated info in the future, should
  there ever be any demand for that, but for now we are simply going
  to retain the existing behaviour.  Users can extend this should
  they wish.

This does require two separate pam_motd lines in your pam service
file, one for the dynamic and one for the static parts (patch
attached).  Enabling the use of /run/motd.dynamic before I create
it in initscripts is harmless, and it means we can seamlessly
switch over once you have made this change.


Thanks,
Roger

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (550, 'unstable'), (500, 'testing'), (400, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages login depends on:
ii  libc6           2.13-30
ii  libpam-modules  1.1.3-7
ii  libpam-runtime  1.1.3-7
ii  libpam0g        1.1.3-7

login recommends no packages.

login suggests no packages.

-- no debconf information
diff -urN shadow-4.1.5.original/debian/login.pam shadow-4.1.5/debian/login.pam
--- shadow-4.1.5.original/debian/login.pam	2012-04-21 09:49:54.000000000 +0100
+++ shadow-4.1.5/debian/login.pam	2012-04-21 09:49:13.019066487 +0100
@@ -80,8 +80,11 @@
 # (Replaces the `LASTLOG_ENAB' option from login.defs)
 session    optional   pam_lastlog.so
 
-# Prints the motd upon succesful login
+# Prints the message of the day upon succesful 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
 
 # Prints the status of the user's mailbox upon succesful login

Reply via email to