public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcc/96035] New: directories created when writing gcov data have limited rights compared to umask
@ 2020-07-02 16:23 michelpalleau at yahoo dot fr
  2020-07-02 16:29 ` [Bug libgcc/96035] " michelpalleau at yahoo dot fr
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: michelpalleau at yahoo dot fr @ 2020-07-02 16:23 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96035
           Summary: directories created when writing gcov data have
                    limited rights compared to umask
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: michelpalleau at yahoo dot fr
  Target Milestone: ---

In libgcov-driver-system.c, function create_file_directory(), any missing
directory is created with "mkdir(filename, 0755)".

>From mkdir's man page: the argument mode specifies the permissions to use. It
is modified by the process's umask in the usual way: the permissions of the
created directory are (mode & ~umask & 0777).

So if the process umask is set to 0, the directories will be created with
rights=0755, while gocv data files will be created with rights=0666.

I do not see the rationale to prevent group & other write permissions on the
created directories if the process umask is not preventing it.
I think the code should be "mkdir(filename, 0777)", so that all directories and
files are created with the process umask. No more, no less.

Long story: I work on an embedded project (with cross compilation), consisting
of several executables that are running with different uids. Even with a
umask=0, the first executable that ends will create the directories and its
coverage files, and the other executables won't be able to write their own
files. If I run all the executables with the same uid, I do not face the
problem.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-07-23 10:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-02 16:23 [Bug libgcc/96035] New: directories created when writing gcov data have limited rights compared to umask michelpalleau at yahoo dot fr
2020-07-02 16:29 ` [Bug libgcc/96035] " michelpalleau at yahoo dot fr
2020-07-03  7:40 ` [Bug gcov-profile/96035] " marxin at gcc dot gnu.org
2020-07-03  7:41 ` marxin at gcc dot gnu.org
2020-07-23 10:20 ` cvs-commit at gcc dot gnu.org
2020-07-23 10:21 ` marxin at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).