Browse Source

move motd generation to avoid user races; kashmir@umiacs.umd.edu

OPENBSD_2_1
deraadt 27 years ago
parent
commit
d56035f24e
1 changed files with 13 additions and 13 deletions
  1. +13
    -13
      src/etc/rc

+ 13
- 13
src/etc/rc View File

@ -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 # System startup script run by init on autoboot
# or after single-user. # or after single-user.
@ -208,6 +208,18 @@ if [ X${securelevel} != X"" ]; then
sysctl -w kern.securelevel=${securelevel} sysctl -w kern.securelevel=${securelevel}
fi 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.* virecovery=/var/tmp/vi.recover/recover.*
if [ "$virecovery" != "/var/tmp/vi.recover/recover.*" ]; then if [ "$virecovery" != "/var/tmp/vi.recover/recover.*" ]; then
echo preserving editor files echo preserving editor files
@ -305,18 +317,6 @@ if [ -f /sbin/kbd -a -f /etc/kbdtype ]; then
kbd `cat /etc/kbdtype` kbd `cat /etc/kbdtype`
fi 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 if [ -f /sbin/ldconfig ]; then
echo 'creating runtime link editor directory cache.' echo 'creating runtime link editor directory cache.'
_LIBS= _LIBS=


Loading…
Cancel
Save