Automatically install required missing pam configurations in upgrade.
authorPeter Avalos <pavalos@theshell.com>
Sat, 24 Jan 2009 21:21:20 +0000 (16:21 -0500)
committerPeter Avalos <pavalos@theshell.com>
Sun, 25 Jan 2009 04:49:39 +0000 (23:49 -0500)
Additionally, warn users that the config files may be out-of-date.  99%
of the time, it's probably best for the user to just do the make install
in etc/pam.d to install the default configuration files.

Reviewed-by: dillon
etc/Makefile
etc/pam.d/Makefile

index d42f752..67921e8 100644 (file)
@@ -176,11 +176,10 @@ upgrade_etc:      preupgrade remove-obsolete-files
        cd ${UPGRADE_SRCDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 Makefile.usr ${DESTDIR}/usr/Makefile
 .if !exists(${DESTDIR}/etc/pam.d)
        mkdir -p ${DESTDIR}/etc/pam.d
-       ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${UPGRADE_SRCDIR}/pam.d/README ${DESTDIR}/etc/pam.d
-       ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${UPGRADE_SRCDIR}/pam.d/convert.sh ${DESTDIR}/etc/pam.d
+       cd ${UPGRADE_SRCDIR}/pam.d; ${MAKE} install
        sh ${DESTDIR}/etc/pam.d/convert.sh ${DESTDIR}/etc/pam.d ${DESTDIR}/etc/pam.conf
 .else
-.for pamconf in README convert.sh
+.for pamconf in README convert.sh atrun cron passwd rsh su system
 .if !exists(${DESTDIR}/etc/pam.d/${pamconf})
        ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${UPGRADE_SRCDIR}/pam.d/${pamconf} ${DESTDIR}/etc/pam.d
 .endif
@@ -239,6 +238,16 @@ upgrade_etc:       preupgrade remove-obsolete-files
 .endif
 .endif
 
+# The existence of cleartext_pass_ok means pam config files are out of date.
+       @set - `fgrep cleartext_pass_ok ${DESTDIR}/etc/pam.d/*`; \
+       if [ $$# -gt 0 ] ; \
+       then \
+               echo "It appears your PAM configuration files need to be updated"; \
+               echo "This can be done by manually editing the files or:"; \
+               echo "  cd ${UPGRADE_SRCDIR}/pam.d"; \
+               echo "  make install"; \
+       fi
+
 distribution:
        cd ${.CURDIR}; \
            ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
index 9e638b0..f5707fa 100644 (file)
@@ -1,6 +1,7 @@
 NOOBJ=
 
 FILES= README \
+       convert.sh \
        atrun \
        cron \
        ftpd \