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

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 1 Dec 2003, Nate Lawson wrote:

NL> >   When clearing /tmp, X11 lock and temporary files are special.
NL> >   Remove them unconditionaly.
NL> >
NL> >   PR:             bin/59065
NL> >   Approved by:    re (scottl)
NL> >
NL> >   Revision  Changes    Path
NL> >   1.5       +13 -13    src/etc/rc.d/cleartmp
NL> >
NL> >  load_rc_config $name
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

?

Sincerely,
D.Marck                                     [DM5020, MCK-RIPE, DM3-RIPN]
------------------------------------------------------------------------
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru ***
------------------------------------------------------------------------



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