bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: temp file creation bug in diffutils 2.7


From: Solar Designer
Subject: Re: temp file creation bug in diffutils 2.7
Date: Thu, 4 Jan 2001 09:52:33 +0300
User-agent: Mutt/1.2.5i

> > This new patch is almost correct, except that I believe the temporary
> > file wouldn't be unlinked (the global tmpname is never set).
> 
> IMHO, there's one other problem with this patch: it doesn't honor 
> $TMPDIR.

Yes, this is just not as important when the accesses are now safe.  I
find it unfortunate that there's no libc interface that would provide
the features of tmpnam(3) and mkstemp(3) combined.  glibc has better
interfaces internally, but these are just not standardized anywhere.
(tmpfile(3) is almost what is needed, except that it doesn't return
the filename.)

Anyway, I've fixed this in the patch, -- plus, there turned out to be
one more case where not all temporary files would be unlinked.

This is very non-portable, but I don't think this patch was ever
meant to be used anywhere other than in GNU/*/Linux distributions.

-- 
/sd

Attachment: diffutils-2.7-immunix-owl-tmp.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]