cvs commit: src/etc/rc.d cleartmp

Nate Lawson nate at root.org
Mon Dec 1 09:28:24 PST 2003


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


More information about the cvs-src mailing list