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

Re: secure temporary directory



> hi,
> 
> I would like to package an app, that needs a 700 tmp directory.
> Where should I put it ? 
> /var/myapp/tmp looks good, but I'm not sure.

In /var/run/myapp would be sensible *if* it is root creating the
directory.  (Note that /var/spool differs from /var/run in that the
former will be preserved across system reboots whereas the latter
won't, and is intended for spooled data to be processed later.)

Alternatively, use one of the secure methods for creating a directory
in /tmp, depending upon the language in which you are writing the
code.  As far as I know, once a directory is created mode 700 in /tmp
(*not* in a non-trusted subdirectory thereof, however), its contents
are secure and readable only by the owner.  There have been
discussions about this before -- you might want to check the mailing
list archives from the last couple of months, perhaps in -mentors,
perhaps in -devel.

   Julian

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

  Julian Gilbey, Dept of Maths, QMW, Univ. of London. J.D.Gilbey@qmw.ac.uk
             Debian GNU/Linux Developer.  jdg@debian.org
       -*- Finger jdg@master.debian.org for my PGP public key. -*-


Reply to: