Don't allow users to prevent the updating of /etc/motd on machines for

which /tmp is not mounted in MFS, clear_tmp_enable="NO" and
update_motd="YES".

PR:	10005
Submitted by:	Anton Voronin <anton@urc.ac.ru>
This commit is contained in:
sheldonh 1999-06-21 15:59:42 +00:00
parent 8055b17e85
commit 7cd92321bd

6
etc/rc
View File

@ -1,5 +1,5 @@
#!/bin/sh
# $Id: rc,v 1.187 1999/04/02 09:35:34 cracauer Exp $
# $Id: rc,v 1.188 1999/06/01 10:47:53 brian Exp $
# From: @(#)rc 5.27 (Berkeley) 6/5/91
# System startup script run by init on autoboot
@ -400,12 +400,12 @@ fi
if [ "X${update_motd}" != X"NO" ]; then
T=/tmp/_motd
rm -f $T
rm -rf $T
uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > $T
awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> $T
cp $T /etc/motd
chmod 644 /etc/motd
rm -f $T
rm -rf $T
fi
# Run rc.devfs if present to customify devfs