[arch-projects] [initscripts][RFC] managing /tmp
d at falconindy.com
Wed May 18 13:24:25 EDT 2011
On Wed, May 18, 2011 at 07:10:41PM +0200, Tom Gundersen wrote:
> On Wed, May 18, 2011 at 7:04 PM, Dave Reisner <d at falconindy.com> wrote:
> > Looking at the patch that triggered this, I'm confused as to why the
> > logic was added to rc.sysinit to begin with. Why conditionally check for
> > /tmp being mounted? What's the harm in unconditionally calling rm -rf
> > /tmp/*? Has it bitten us in the past? The commit message doesn't even
> > cover this change.
> The original change was completely stupid and will be reverted for the
> next release (unless we skip the /tmp cleaning altogether). I had been
> reading bug reports about being able to trick "rm /tmp/*" to delete
> things outside of /tmp, but I am not able to reproduce it, so I guess
> the bug reports were bogus. I hadn't intended for this change to be
> pushed out (that's why it was not in the commit msg), but must have
> been a bit too eager with the "git add -p"...
I can only think of 1 reason that would happen, and it's completely
ridiculous: If you bind mount things into /tmp, then recursively
deleting /tmp would nuke things on the mounts as well. I don't think
there's a legitimate case for this though.
rm does not follow symlinks, and my only other concern would be what
happens when nullglob is set and the glob fails to expand-- but a quick
test shows that not be a concern either.
More information about the arch-projects