Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: "José Pekkarinen" <jose.pekkarinen@unikie.com>, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] system: add optional rsync with preserved permissions
Date: Mon, 4 Oct 2021 17:10:21 +0200	[thread overview]
Message-ID: <20211004151021.GC1504958@scaer> (raw)
In-Reply-To: <20211004090036.65722dda@windsurf>

Thomas, José, All,

On 2021-10-04 09:00 +0200, Thomas Petazzoni spake thusly:
> On Mon,  4 Oct 2021 09:41:43 +0300
> José Pekkarinen <jose.pekkarinen@unikie.com> wrote:
> 
> > +config BR2_ROOTFS_OVERLAY_PRESERVED_PERMISSION
> > +	string "Preserve permissions of overlay directories"
> > +	depends on BR2_ROOTFS_OVERLAY
> > +	default "n"
> > +	help
> > +	  Preserve file permissions of specified overlay.
> 
> I'm afraid we probably won't want an option like this.

Agreed, we already have two mechanisms for that, see below.

> The question is why in the existing SYSTEM_RSYNC we don't preserve
> permissions? I can imagine because sometimes they can be wrong in the
> original overlay, for example with version control systems that put all
> files read-only.
> 
> Yann, Arnout: do you remember why SYSTEM_RSYNC has --chmod=u=rwX,go=rX ?

The reason is that indeed, we have no way to validate the access modes
and ownership for those files. As the build will (most probably) be made
as a non-root user, there is no way we can set arbitrary modes or owners
to those files when we copy them, even if the source tree had proper
owenrship and modes etc...

So we can only enforce a known mode, that is reproducible, and let the
user provide a permission table (or even a fakeroot-script, although I
would personally highly favour a permission table, which could be
generated in a post-build script if needed).

This applies to file ownership and modes (think set-uid root), but also
to extended attributes (think SELinux security context set as extended
attributes). All of that can be set with a permission table.

> José: have you considered using a permission table to fixup the
> permissions ?

This is *the* mechanism to use to set arbitrary ownership, modes, and
extended attributes to arbitrary files.

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

      parent reply	other threads:[~2021-10-04 15:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04  6:41 [Buildroot] [PATCH] system: add optional rsync with preserved permissions José Pekkarinen
2021-10-04  7:00 ` Thomas Petazzoni
2021-10-04  7:08   ` José Pekkarinen
2021-10-04  7:30     ` Thomas Petazzoni
2021-10-04 15:15     ` Yann E. MORIN
2021-10-04 15:10   ` Yann E. MORIN [this message]

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=20211004151021.GC1504958@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=jose.pekkarinen@unikie.com \
    --cc=thomas.petazzoni@bootlin.com \
    /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