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

* [Bug libgcc/96035] directories created when writing gcov data have limited rights compared to umask
  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 ` michelpalleau at yahoo dot fr
  2020-07-03  7:40 ` [Bug gcov-profile/96035] " marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: michelpalleau at yahoo dot fr @ 2020-07-02 16:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Michel Palleau <michelpalleau at yahoo dot fr> ---
Created attachment 48826
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48826&action=edit
Proposal to create directories with process umask

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

* [Bug gcov-profile/96035] directories created when writing gcov data have limited rights compared to umask
  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 ` marxin at gcc dot gnu.org
  2020-07-03  7:41 ` marxin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-07-03  7:40 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-07-03
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Thank you for the report. I'm not familiar enough with umask, but your
explanation makes sense to me.
@Jakub, Richi: Can you please help us here?

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

* [Bug gcov-profile/96035] directories created when writing gcov data have limited rights compared to umask
  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
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-07-03  7:41 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |marxin at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

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

* [Bug gcov-profile/96035] directories created when writing gcov data have limited rights compared to umask
  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
                   ` (2 preceding siblings ...)
  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
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-07-23 10:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Liska <marxin@gcc.gnu.org>:

https://gcc.gnu.org/g:24c35a5ef3f88cf3c25c8bf17f9ff706e4286f53

commit r11-2285-g24c35a5ef3f88cf3c25c8bf17f9ff706e4286f53
Author: Martin Liska <mliska@suse.cz>
Date:   Fri Jul 10 10:56:34 2020 +0200

    gcov: create folders with 0777.

    libgcc/ChangeLog:

            PR gcov-profile/96035
            * libgcov-driver-system.c: Create gcov folders with 0777
            so that it respects a system umask.

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

* [Bug gcov-profile/96035] directories created when writing gcov data have limited rights compared to umask
  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
                   ` (3 preceding siblings ...)
  2020-07-23 10:20 ` cvs-commit at gcc dot gnu.org
@ 2020-07-23 10:21 ` marxin at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-07-23 10:21 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed, thank you Michael for the patch.

^ 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).