Re: dangerouse function call


Subject: Re: dangerouse function call
From: Sam TH (sam@uchicago.edu)
Date: Mon Apr 30 2001 - 17:37:38 CDT


On Mon, Apr 30, 2001 at 11:39:58PM +0100, Rui M Silva wrote:
> Hello,
>
> While compiling, abi gave me the following warning:
>
> /home/rms/cvs/abiword/abi/src/Linux_2.4.3_i386_GNOME/obj/libAbiUtil.a(ut_unixString.o): In function `UT_tmpnam':
> /home/rms/cvs/abiword/abi/src/af/util/unix/ut_unixString.cpp:51: the use of `tmpnam' is dangerous, better use `mkstemp'
>
>
> After a quick review of man mkstemp, I really believe we should not use tmpnam.
>
> Just think of a link to the wrong place...
>
> I only do not offer a patch, since I am not sure of what goes in
> that string there, and mkstemp requires <<The last six characters of
> template must be XXXXXX and these are replaced with a string that
> makes the filename unique.>> I thought that I'd better place this
> warning to the list.

We tried this before, and mkstemp is non-portable to platforms that
we build on. However, better solutions would make me very happy, so
that I never have to see that warning again.
           
sam th --- sam@uchicago.edu --- http://www.abisource.com/~sam/
OpenPGP Key: CABD33FC --- http://samth.dyndns.org/key
DeCSS: http://samth.dynds.org/decss




This archive was generated by hypermail 2b25 : Mon Apr 30 2001 - 17:23:57 CDT