• [gentoo-dev] [PATCH 1/2] acct-group.eclass: Don't modify groups when EP

    From James Le Cuirot@21:1/5 to All on Thu Dec 8 22:30:01 2022
    This was happening when running a prefix as root, which we don't really support, but also when building a prefixed system under ROOT.

    Closes: https://bugs.gentoo.org/779181
    Signed-off-by: James Le Cuirot <chewi@gentoo.org>
    ---
    eclass/acct-group.eclass | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/eclass/acct-group.eclass b/eclass/acct-group.eclass
    index 590a2f20ed8e..f55c9f4c9587 100644
    --- a/eclass/acct-group.eclass
    +++ b/eclass/acct-group.eclass
    @@ -157,7 +157,7 @@ acct-group_src_install() {
    acct-group_pkg_preinst() {
    debug-print-function ${FUNCNAME} "${@}"

    - if [[ ${EUID} -ne 0 ]]; then
    + if [[ ${EUID} -ne 0 || -n ${EPREFIX} ]]; then
    einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
    return
    fi
    --
    2.38.1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?=@21:1/5 to James Le Cuirot on Fri Dec 9 05:30:01 2022
    On Thu, 2022-12-08 at 21:28 +0000, James Le Cuirot wrote:
    This was happening when running a prefix as root, which we don't really support, but also when building a prefixed system under ROOT.

    Closes: https://bugs.gentoo.org/779181
    Signed-off-by: James Le Cuirot <chewi@gentoo.org>
    ---
    eclass/acct-group.eclass | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/eclass/acct-group.eclass b/eclass/acct-group.eclass
    index 590a2f20ed8e..f55c9f4c9587 100644
    --- a/eclass/acct-group.eclass
    +++ b/eclass/acct-group.eclass
    @@ -157,7 +157,7 @@ acct-group_src_install() {
    acct-group_pkg_preinst() {
    debug-print-function ${FUNCNAME} "${@}"

    - if [[ ${EUID} -ne 0 ]]; then
    + if [[ ${EUID} -ne 0 || -n ${EPREFIX} ]]; then
    einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
    return
    fi

    I dare say the message is not necessarily correct here but I suppose it
    doesn't matter that much.

    --
    Best regards,
    Michał Górny

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Le Cuirot@21:1/5 to All on Fri Dec 9 12:20:01 2022
    On Fri, 2022-12-09 at 05:23 +0100, Michał Górny wrote:
    On Thu, 2022-12-08 at 21:28 +0000, James Le Cuirot wrote:
    This was happening when running a prefix as root, which we don't really support, but also when building a prefixed system under ROOT.

    Closes: https://bugs.gentoo.org/779181
    Signed-off-by: James Le Cuirot <chewi@gentoo.org>
    ---
    eclass/acct-group.eclass | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/eclass/acct-group.eclass b/eclass/acct-group.eclass
    index 590a2f20ed8e..f55c9f4c9587 100644
    --- a/eclass/acct-group.eclass
    +++ b/eclass/acct-group.eclass
    @@ -157,7 +157,7 @@ acct-group_src_install() {
    acct-group_pkg_preinst() {
    debug-print-function ${FUNCNAME} "${@}"

    - if [[ ${EUID} -ne 0 ]]; then
    + if [[ ${EUID} -ne 0 || -n ${EPREFIX} ]]; then
    einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
    return
    fi

    I dare say the message is not necessarily correct here but I suppose it doesn't matter that much.

    Yeah, I thought that too, but not enough for such a corner case.

    -----BEGIN PGP SIGNATURE-----

    iQJFBAABCAAvFiEEPxcZ3tkwcedKm2a8EiZBXQDdMTcFAmOTGEgRHGNoZXdpQGdl bnRvby5vcmcACgkQEiZBXQDdMTfv3g/8Dfe4hHBpKk/8oQ7/Vr3uFKva4JHA6bUy h4Kdf31KdPM2Thwd0N4JqnZ6OFwTcTq0viqS00nzGR5BoJG9QWBFk1ZbXqkrfdup gRpg8Wu7xDfAlC8w/R96Rp80y4q5oJx9z+ZZEQMy5jCJ9DRJBHEES086fiyQiQgq OYESjVa5YQQk7peDCWRoFUZ4Xu14zpMeYnlA4XnufuoBG0evq+hDIswnBHX0mcJP CXoE4KvCCEPzK25UfUi0wSQYTlB68not9JMcQU9iUR7I/51WUi5mrW9zN5Vtu+b6 +86KMMGmZt7nsOi6deF0hnmAKOn43AVdA7i7pgH5ei7BufH2pmFpjiKVCTJHVmZj Rj5Epxfe5xijn0Bl1UYGjFXO2dUXI1xTWK21FMqRVWe2L83Y1LXCn0ouG0Yxk1js owUVUjVlmJV+fNX3wwHOGIDnI5K4eMAeOLo8QdLfliRpJRVfrI1LMthcVCm/mZuN c1O7uUxGXIU1TQzHs0iox/hnK76c1pW0pqWtoY000uPDASzXP/EUJaeDVD+qFGwq 6Jqma+f1FlBGpRuU9NPbhpbUS05EzlDu9Eo2LaefxwIxWPMkpB9WNmpHekL0lTuI p36CLNy8a0h3LWnbboHeLKPWsJbC903GAYYiSJSvE+sVXgeXOWUbpj58Pj2cmUpO
    70JQa6+wwkI=
    =2mh9
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)