From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82792 invoked by alias); 19 Jul 2015 22:17:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 82760 invoked by uid 48); 19 Jul 2015 22:16:55 -0000 From: "keith.marshall at mailinator dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/66936] io/unix.c gratuitously uses S_IRWXG and S_IRWXO on the basis that umask() is available Date: Sun, 19 Jul 2015 22:17:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libfortran X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: keith.marshall at mailinator dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P5 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-07/txt/msg01684.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66936 --- Comment #8 from Keith Marshall --- (In reply to kargl from comment #7) > So add > > #define S_IRWXG 0 > #define S_IRWXO 0 > > to the header file wherever mingw defines the available mask bits > for umask(3). The bug is clearly in mingw were it gratuitously maps > umask() to _umask() without properly adding the mappings for the > mode_t argument bits of umask(3). Absolutely not! Those bits are utterly irrelevant for the windows (MinGW) platform; to add them would be do nothing more than create confusion. The mask bits for umask(), on the windows platform are S_IREAD | S_IWRITE; those are the only mask bits YOUR code should be passing to non-POSIX umask(5axxx3be.aspx). This is NOT a MinGW bug; it's a GCC bug, and that's where it should be fixed. Until you do fix it, I have my work-around, (which I'm perfectly willing to publish in MinGW forked source for GCC, prominently commented as a ghastly hack to circumvent a gross upstream GCC bug).