This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: GNU GCC's f77 [tempnam -> mkstemp; proposed patch]
- To: Richard Henderson <rth at redhat dot com>
- Subject: Re: GNU GCC's f77 [tempnam -> mkstemp; proposed patch]
- From: "Zack Weinberg" <zackw at Stanford dot EDU>
- Date: Tue, 14 Nov 2000 23:09:45 -0800
- Cc: Toon Moene <toon at moene dot indiv dot nluug dot nl>, Murakami Hiroshi <murakami at tmca dot ac dot jp>, bug-gcc at gnu dot org, gcc-patches at gcc dot gnu dot org
- References: <20001001141745.38676.qmail@amdk6.honkan3.tmca.ac.jp> <3A105663.60E6126A@moene.indiv.nluug.nl> <20001113143645.N235@wolery.stanford.edu> <3A11B1E1.D47852CD@moene.indiv.nluug.nl> <20001114145206.C23518@redhat.com>
On Tue, Nov 14, 2000 at 02:52:06PM -0800, Richard Henderson wrote:
> On Tue, Nov 14, 2000 at 10:42:57PM +0100, Toon Moene wrote:
> > If noone shoots a hole in this update before tomorrow 18 UTC, I'll apply
> > the patch:
>
> Well, I don't see anything wrong with the patch itself. But
> looking at the surrounding code I'd say it's pointless. If
> you go and close the file immediately, and re-open it by name
> you've just obviated all the benefit of using mkstemp.
But mkstemp has created the file, so unless you unlink it, you own
that name. Right? Absent a malicious root or bad permissions on
/tmp... okay, it's not ideal.
> Really, that code is so ugly as to be practially unsalvagable.
No argument from me here.
zw