Re: [PATCH v3] Copy files/* into the work tree instead of symlinking it

Ulrich Mueller <[email protected]> Mon, 27 Sep 2021 12:49:12 +0200
Newsgroups gmane.linux.gentoo.portage.devel
Message-ID <[email protected]>
>>>>> On Sun, 26 Sep 2021, Michał Górny wrote:

> Symlinking FILESDIR into the work tree has the unintended consequence
> of preserving all original file metadata, including system-specific ACLs
> and so on.  When these files are installed, this could lead to
> unintentionally copying this metadata to the system and/or binary
> packages.

> Let's copy all files instead and drop metadata in the process.  Since
> FILESDIR is expected to be small by design, this shouldn't cause any
> major trouble.  It is also easier and less likely to cause regressions
> than making sure stuff is not preserved when installing.

> Unfortunately, a similar problem applies to DISTDIR.  However,
> installing files from DISTDIR is rarer than from FILESDIR, so I guess
> we'll cross that bridge when we get to it.

Sorry for the late reply, but this looks like the wrong solution to me.

Looking at the installation helpers (doins, doexe, etc.), they don't
preserve the normal permission bits, but reset them to a defined state.
So why would they preserve xattrs?

I don't see anything in PMS that would mandate that behaviour (on the
contrary, in section 13.3.1 there is "Other file attributes may be
discarded"). How do the other package managers handle this?

Ulrich
signature.asc (application/pgp-signature, 507 B)
-----BEGIN PGP SIGNATURE-----

iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmFRoagPHHVsbUBnZW50
b28ub3JnAAoJEFGIM1CIQV4ultkH/jFU4nflM4L4HCjM8jWjpyB+S8vyJCSt8Go4
8xh9CmnfVMSzwN5KOE44AIjlN7g1GgHWNuiUQi6c0SlFxnC8DBrbaIm4iMLPVUus
XyhHIzkFlDrFMsDTaWbUEa4hh3XPPQ8mQKcPnIKO/mmZgiG8eTkPchddhQu9BEh+
uX7Kv4DEQvNdmd5GS9lzoPOj9awhOYO3mvMRy9d6XMo3c1AeB07Ab5MxteLQBo1I
nWZZ3B+Uu/sO6Lo1WbfBKvtzbtIdl18fU5ORBm/+OHyCNTFqibywlrNibf5agR2e
o7e1cEOXHXVgKaSScwX/9aNDcJmbHn1OfFazXFjO99gQGV7QJlA=
=7jHj
-----END PGP SIGNATURE-----