lmi
[Top][All Lists]
Advanced

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

Re: [lmi] [lmi-commits] master 5567c43 1/3: Begin to tackle an observed


From: Greg Chicares
Subject: Re: [lmi] [lmi-commits] master 5567c43 1/3: Begin to tackle an observed unit-test failure
Date: Mon, 17 Aug 2020 01:50:09 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0

On 2020-08-16 23:43, Vadim Zeitlin wrote:
> On Sun, 16 Aug 2020 19:34:52 -0400 (EDT) Greg Chicares 
> <gchicares@sbcglobal.net> wrote:
> 
> GC>     The approach taken here is to uniquify the directory name. In the 
> shell,
> GC>     it would be natural to use a command like mktemp(1). C and C++ offer
> GC>     mktemp(3), but the freebsd manpage says it's "particularly dangerous
> GC>     from a security perspective", the openbsd linker warns whenever it's
> GC>     used, and the linux manpage says "Never use mktemp()". Instead, lmi's
> GC>     unique_filepath() function is used here.
> 
>  FWIW, the replacement for mktemp() is mkstemp() and AFAIK MinGW does
> provide its implementation even for MSW (although MSVC does not).

*nix has a family of /mko*s*temps*/ functions, while ms recommends its own
variant, _mktemp_s(). Or would my use case call for mkdtemp()? It looked
like it would take so much effort to figure all that stuff out that I'd be
better off using my own (tested) function.


reply via email to

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