Re: executable scripts in /tmp



Hi, Philip!

> mc currently writes executable scripts into /tmp.

I'll fix it.  Added to src/TODO and committed.

> I think this is something that should generally be avoided.

I haven't heard that it should be avoided in general (apart from
portability to 20 years old UNIX without "#!" support).  Any references?

> On my pokey little server I have /tmp mounted noexec because
> I am paranoid.

OK, reliance on the ability to execute scripts seems unnecessary.

> Why, since ~/.mc/tmp exists, and is used by mc anyway, doesn't
> mc just use ~/.mc/tmp for everything?

There is no reason whatsoever to believe that the home directory is less 
likely to be mounted noexec than /tmp.  Really paranoid sysadmins would 
make both noexec :-)

On the other hand, I've seen installations where the home directory is
mounted over NFS and shared between several machines.  That's not a good
choice for temporary files.

~/.mc/tmp is only used by the wrapper script used to propagate the last
directory.  There are other problems with that script, and fixing all this
mess is already in TODO.

> I have patched it to do this (by editing mc.ext and starting mc with
> "/usr/bin/env TMPDIR=~/.mc/tmp") and it works splendidly this way.  Of
> course the proper fix simply requires replacing TMPDIR with HOME/.mc/tmp
> in the right place(s).

I think that ignoring TMPDIR is a bad thing.  TMPDIR is used to allow
administrators to specify where all temporary files should be stored, and
this directory is usually located on a very fast drive or even in memory.

> Is there a reason it does not do this by default?

See above.

> Should I submit a proper patch?

Implementation of your suggestions would not be a proper patch.

-- 
Regards,
Pavel Roskin




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]