Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Pesce Luca <Luca.Pesce@vimar.com>
Cc: "buildroot@buildroot.org" <buildroot@buildroot.org>
Subject: Re: [Buildroot] R: [PATCH] support/download/dl-wrapper: make the whole dl_dir writeable for the group
Date: Fri, 2 Dec 2022 20:29:38 +0100	[thread overview]
Message-ID: <20221202192938.GA3302@scaer> (raw)
In-Reply-To: <AS8PR08MB6870CBA6B56FA36972D523AA81179@AS8PR08MB6870.eurprd08.prod.outlook.com>

Luca, All,

On 2022-12-02 13:47 +0000, Pesce Luca spake thusly:
> > Da: Yann E. MORIN <yann.morin.1998@free.fr>
> > Inviato: giovedì 1 dicembre 2022 21:25
> > A: Pesce Luca
> > Cc: buildroot@buildroot.org
> > Oggetto: Re: [Buildroot] [PATCH] support/download/dl-wrapper: make the whole dl_dir writeable for the group
[--SNIP--]
> > > +    # Make the whole dl_dir writeable for the group, so other users within
> > > +    # the group can download new versions and update any vcs cache in it.
> > > +    chmod -f -R g+w "${dl_dir}"
> > But what if the user initially had umask 0022 to begin with? By forcing
> > the group authorization with the chmod, you are overriding the user's
> > umask settings, which is not good... I for one would not want to have
> > group-writable directories (or files) created when I would have not
> > expected it.
> Yes, I can agree with this. However, BR already overrides the user's umask,
> and, at least in my case (umask=0002), this changes the user's default,
> denying g+w by design.

Yes, but the reason we do enforce a known umask, is to guarantee some
kind of reproducibility in the generated target image. See commit
bee5745ccc20 (Makefile: don't depend on the umask) which explains,
albeit only briefly, why we do it:

    Some packages and BR itself create files and directories on the target
    with cp/mkdir/etc which depend on the umask at the time of building.

Doing the fixups in target with an explicit chmod or whatever is not
possible. Indeed, some packages also do their own chmod, and we have no
way to know.

So, we can only resort to using a known umask. We chose 0022 because it
is sane by default, and usually, packages that install files like
executalbes, will want those to be world-executable (a system would not
be very useful is only root could run programs).

> > Instead, what about something like:
[--SNIP--]
> Yes, this looks good to me: you honor user's umask in the whole download
> phase, and keep the 0022 for other files created by BR. So a better approach,
> for sure!

Could you handle refining this change, test it, and when/if that works,
send it as a proper patch, please?

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2022-12-02 19:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-15  7:21 [Buildroot] BR2_DL_DIR permissions Pesce Luca via buildroot
2022-11-30 13:43 ` [Buildroot] [PATCH] support/download/dl-wrapper: make the whole dl_dir writeable for the group Luca Pesce via buildroot
2022-12-01  7:17   ` [Buildroot] R: " Pesce Luca via buildroot
2022-12-01 20:25   ` [Buildroot] " Yann E. MORIN
2022-12-02 13:47     ` [Buildroot] R: " Pesce Luca via buildroot
2022-12-02 19:29       ` Yann E. MORIN [this message]
2022-12-05 12:36         ` [Buildroot] R: " Pesce Luca via buildroot
2022-12-05 20:37           ` Yann E. MORIN

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=20221202192938.GA3302@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=Luca.Pesce@vimar.com \
    --cc=buildroot@buildroot.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