Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 May 2007 12:36:18 -0500
From:      Craig Boston <craig@xfoil.gank.org>
To:        Doug Barton <dougb@FreeBSD.org>
Cc:        freebsd-current@FreeBSD.ORG, "Ralf S. Engelschall" <rse@FreeBSD.ORG>
Subject:   Re: etc/rc.d/{var,tmp} and sub-shell usage?!
Message-ID:  <20070523173618.GA22034@nowhere>
In-Reply-To: <20070523101529.K46653@ync.qbhto.arg>
References:  <200705230911.l4N9Bssl015397@lurza.secnetix.de> <20070523101529.K46653@ync.qbhto.arg>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, May 23, 2007 at 10:21:23AM -0700, Doug Barton wrote:
> Using 'echo > file' will work just as well, and avoid the cost of invoking 
> ln.

It seems like that could be vulnerable to malicious symbolic links lying
around from the previous boot.  Doing an rm first should work as during
this stage of system startup there shouldn't be any race conditions.

ln has the -h flag to not follow links, so it may be a better option,
especially if you would have to invoke rm anyway.

Craig



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070523173618.GA22034>