first bunch of patches with mkstemp()

Russ Allbery rra at stanford.edu
Thu Apr 6 01:22:36 UTC 2000


Matus \"fantomas\" Uhlar <uhlar at fantomas.sk> writes:

> FreeBSD (and possibly other systems) implement function mkstemp()

Linux and Solaris do as well.

> there are many programs using mktemp() in inn, this is patch to some of
> them (those which were easier to patch)

> OK, i didn't add any tests for HAVE_MKSTEMP into config, i dunno how to
> do it :( and i'll mail infor about the rest later

This is a good start -- thank you for the patch!  Here's where I think we
should go with this:

My philosophy on changes of this sort is to minimize the number of places
where we have to do autoconf tests.  The reader or hacker of INN code
should be able to just write in C, not in heavily preprocessor-ridden C,
and not have to worry about portability as much as possible.

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.  That avoids the #ifdef maze in each source file and should
result in more readable code down the road.

Since INN uses its own temporary directory rather than the system
temporary directory, this isn't really a security issue and therefore I
don't think it's pressing enough to try to rush into 2.3.  If you'd be
willing, I'd much rather see the final solution outlined above done and go
into the tree after the release branch is cut.

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



More information about the inn-patches mailing list