public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "michelpalleau at yahoo dot fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgcc/96035] New: directories created when writing gcov data have limited rights compared to umask
Date: Thu, 02 Jul 2020 16:23:37 +0000 [thread overview]
Message-ID: <bug-96035-4@http.gcc.gnu.org/bugzilla/> (raw)
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.
next reply other threads:[~2020-07-02 16:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-02 16:23 michelpalleau at yahoo dot fr [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-96035-4@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).