From: deraadt Date: Tue, 22 Apr 1997 23:04:57 +0000 (+0000) Subject: move motd generation to avoid user races; kashmir@umiacs.umd.edu X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=dc279d04493380f519e05578fc88cd0295b94768;p=openbsd move motd generation to avoid user races; kashmir@umiacs.umd.edu --- diff --git a/etc/rc b/etc/rc index 805a81463fb..349a7b8ca37 100644 --- a/etc/rc +++ b/etc/rc @@ -1,4 +1,4 @@ -# $OpenBSD: rc,v 1.33 1997/04/16 05:48:27 millert Exp $ +# $OpenBSD: rc,v 1.34 1997/04/22 23:04:57 deraadt Exp $ # System startup script run by init on autoboot # or after single-user. @@ -208,6 +208,18 @@ if [ X${securelevel} != X"" ]; then sysctl -w kern.securelevel=${securelevel} fi +# patch /etc/motd +if [ ! -f /etc/motd ]; then + install -c -o root -g wheel -m 664 /dev/null /etc/motd +fi +T=/tmp/_motd +rm -f $T +sysctl -n kern.version | sed 1q > $T +echo "" >> $T +sed '1,/^$/d' < /etc/motd >> $T +cmp -s $T /etc/motd || cp $T /etc/motd +rm -f $T + virecovery=/var/tmp/vi.recover/recover.* if [ "$virecovery" != "/var/tmp/vi.recover/recover.*" ]; then echo preserving editor files @@ -305,18 +317,6 @@ if [ -f /sbin/kbd -a -f /etc/kbdtype ]; then kbd `cat /etc/kbdtype` fi -# patch /etc/motd -if [ ! -f /etc/motd ]; then - install -c -o root -g wheel -m 664 /dev/null /etc/motd -fi -T=/tmp/_motd -rm -f $T -sysctl -n kern.version | sed 1q > $T -echo "" >> $T -sed '1,/^$/d' < /etc/motd >> $T -cmp -s $T /etc/motd || cp $T /etc/motd -rm -f $T - if [ -f /sbin/ldconfig ]; then echo 'creating runtime link editor directory cache.' _LIBS=