https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66936

--- Comment #6 from Keith Marshall <keith.marshall at mailinator dot com> ---
(In reply to kargl from comment #4)
> Update title.  The code in question is
> 
> #ifdef HAVE_UMASK
>   /* Temporarily set the umask such that the file has 0600 permissions.  */
>   mode_mask = umask (S_IXUSR | S_IRWXG | S_IRWXO);
> #endif
> 
> MinGW appears to define HAVE_UMASK, but MinGW seems to lack
> a correctly written umask(3).

Just for the record: MinGW has had access to Microsoft's umask() implementation
for a very long time; HAVE_UMASK has always been defined, when compiling the
mingw32 builds of GCC.  However, this particular block of code is encapsulated
within an outer #ifdef HAVE_MKSTEMP block, and it is only recently that MinGW
has provided an implementation of mkstemp(), (Microsoft do not offer one),
which has caused HAVE_MKSTEMP to become defined, so exposing this (presumably
long-standing) bug.

Reply via email to