Package: libpam-modules
Version: 1.1.3-7.1

libpam-modules contains pam_motd, which should disaplay a motd and
update it dynamically.

The man page states, that there is an option noupdate to disable
updating the motd, otherwise it is updated. By default /etc/pam.d/sshd
contains lines like

session optional pam_motd.so motd=/run/motd.dynamic noupdate
session optional pam_motd.so

The last entry makes pam_motd.so show /etc/motd - and makes it also
update a third motd file (that is not mentioned anywhere except in the
source code): /var/run/motd

The latter path is hardcoded here:
http://patch-tracker.debian.org/patch/series/view/pam/1.1.1-6.1+squeeze1/update-motd

Also /run/motd.dynamic is updated by a init.d script, that only writes
the output of uname into it, ignoring scripts in /etc/update-motd.d,
that are used by pam_motd.so to update /var/run/motd.

This is not a clean design and badly documented. Therefore I propose the
following changes:

1) Make the motd init script use /etc/update-motd.d and the uname
command to a script there

2) Fix pam_motd.so to update the motd file given in the motd option
instead of always /var/run/motd

3) Change the sshd pam config to:

session optional pam_motd.so motd=/run/motd.dynamic
session optional pam_motd.so noupdate

-> This will first show the dynamic motd and update it if required. Then
it will show /etc/motd, that can contain static contents.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to