diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-04-22 23:04:58 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-04-22 23:04:58 +0000 |
commit | a71a5b142c4ac48278eed8c369507c7f075fb3cf (patch) | |
tree | ae55542e987df3948420d684a8cde33c496a645c /etc | |
parent | 472b65f8cd68fdba2224a988cb0ed8a3386d677f (diff) |
move motd generation to avoid user races; kashmir@umiacs.umd.edu
Diffstat (limited to 'etc')
-rw-r--r-- | etc/rc | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -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= |