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

Re: dmake in debian



On Mon, Aug 19, 2002 at 11:59:24PM +0200, Robert Millan wrote:
> On Mon, Aug 19, 2002 at 08:01:58PM +0200, Florent Rougon wrote:
> > Robert Millan <zeratul2@wanadoo.es> wrote:
> > 
> > > sysintf.o: In function `Get_temp':
> > > sysintf.o(.text+0x5fc): the use of `tempnam' is dangerous, better use `mkstemp'

Thanks Robert and Florent for the discussion about alternatives to tempnam.
Unfortunately, the semantics of dmake's tempfile usage are not typical,
meaning the suggested functions can not be used as simple drop-in
replacements without some careful analysis and testing, which is why I have
not made the change already.  

tempnam is used in two ways.  The first one is similar enough to the
suggested version to make modification possible: a temporary name is
obtained in one function, and a new file is created in another.  The second
case is when tempnam is used to define a macro that can later be used as a
temporary filename if needed, also in user makefiles.

So, I'm sure that it is possible to change this behaviour but it would not
be a trivial patch and I didn't have the time to make a full one.  The
temporary files that are created are in the current working directory, not
in /tmp, so I made a wrapper that would refuse to run dmake in a directory
with group or other write permissions, unless the user specifically allowed
it, although that is not the ideal solution.

Chris

Attachment: pgpXauWd49TCe.pgp
Description: PGP signature


Reply to: