first bunch of patches with mkstemp()

Russ Allbery rra at stanford.edu
Tue Aug 7 22:47:28 UTC 2001


greg andruk <gja at meowing.net> writes:
> in inn-patches, Russ Allbery wrote:

>> So what I'd like to see is for us to provide an implementation of
>> mkstemp in terms of mktemp for those systems that don't have it, add
>> mkstemp to AC_REPLACE_FUNCS in configure.in, and then convert INN to
>> just use mkstemp everywhere.

> What to do with the places in INN where mkstemp() is not a useful
> alternative? Two icky spots are the trick of rename()ing a dotfile to
> make it (in)visible to rnews [e.g. nrpd/post.c spooling] and the temp
> fifos/sockets used in lib/inndcomm.c/ICCopen().  These can have problems
> of their own (one of which mkstemp itself has), but not really the
> problem mkstemp is trying to solve.

In both cases, all INN really needs is a temporary filename generator that
can be completely predictable, since only INN can write to those
directories.  Correct?

If so, the easiest would probably be to just write a function that does
only that, and then document that it shouldn't ever be used to create
temporary files in world-writeable directories (and maybe through some
checks into the function so that it refuses to generate file names in
world-writeable directories).

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>


More information about the inn-workers mailing list