Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!hollie.rdg.dec.com!jch From: jch@dyfed.rdg.dec.com (John Haxby) Newsgroups: comp.unix.ultrix Subject: Re: Ultrix x.x /etc/rc.local security holes via /tmp/t1 Message-ID: <1991Mar1.093435.6406@hollie.rdg.dec.com> Date: 1 Mar 91 09:34:35 GMT References: <1991Feb28.083356.6769@watcgl.waterloo.edu> <1991Feb28.131938.29631@cs.widener.edu> Sender: news@hollie.rdg.dec.com (Mr News) Reply-To: jch@dyfed.rdg.dec.com (John Haxby) Organization: Digital Equipment Corporation Lines: 30 You don't actually need these temporary files at all. I got fed up of waiting for the edit on reboot so I re-wrote it to look like this: ------------------------------ VERSION=`echo version\?s | adb /vmunix - | sed -e 1d -e 's/_version:[ \t]*//'` 2>&1 > /dev/console if [ "$VERSION" != "" ] then echo $VERSION echo -n 'update /etc/motd ...' mv /etc/motd /etc/motd.BAK (echo $VERSION; grep -v ULTRIX /etc/motd.BAK) > /etc/motd echo -n ' update /etc/gettytab ...' VERSION=`echo $VERSION | sed 's/System.*//'` (echo '/^ULTRIX.*/s//'"$VERSION"'\\'; echo w) | ed /etc/gettytab > /dev/null echo ' done.' fi 2>&1 >/dev/console --------------- (The \t is a tab). I suspect a similar thing could be done for a mips machine (that doesn't have adb); although you could always go back and use the slow `strings' it needs be. -- John Haxby, Definitively Wrong. Digital Reading, England <...!ukc!wessex!jch>