Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Dec 2003 09:28:19 -0800 (PST)
From:      Nate Lawson <nate@root.org>
To:        Dmitry Morozovsky <marck@rinet.ru>
Cc:        cvs-all@freebsd.org
Subject:   Re: cvs commit: src/etc/rc.d cleartmp
Message-ID:  <20031201092551.A13395@root.org>
In-Reply-To: <20031201195318.O68895@woozle.rinet.ru>
References:  <20031201163631.B160A16A557@hub.freebsd.org> <20031201084533.H13221@root.org> <20031201195318.O68895@woozle.rinet.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 1 Dec 2003, Dmitry Morozovsky wrote:
> On Mon, 1 Dec 2003, Nate Lawson wrote:
> NL> >  run_rc_command "$1"
> NL> > +
> NL> > +case ${OSTYPE} in
> NL> > +FreeBSD)
> NL> > +	# Remove X lock files, since they will prevent you from
> NL> > +	# restarting X
> NL> > +	#
> NL> > +	rm -f /tmp/.X*-lock
> NL> > +	rm -fr /tmp/.X11-unix
> NL> > +	mkdir -m 1777 /tmp/.X11-unix
> NL> > +	;;
> NL> > +NetBSD)
> NL> > +	;;
> NL> > +esac
> NL>
> NL> How about .X[0-9]-lock instead of *?
>
> Hmm... what about (rare, but possible) situation with symlink poisoning?
>
> Maybe
>
> find /tmp -name '.X[0-9]-lock -type f | xargs rm -f
> [ -d /tmp/.X11-unix ] && rm -rf /tmp/.X11-unix
> mkdir -m 1777 /tmp/.X11-unix

rm doesn't follow symlinks.  But yes, filename poisoning is the kind of
thing I thought needed to be solved.

-Nate



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