Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 924032 - app-shells/zsh excludes unprefixied PATH set by ${EPREFIX}/etc/profile.env for root or EUID=1000 due to ROOTPATH
Summary: app-shells/zsh excludes unprefixied PATH set by ${EPREFIX}/etc/profile.env fo...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Matthias Maier
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2024-02-08 06:51 UTC by Yiyang Wu
Modified: 2024-02-08 17:37 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yiyang Wu 2024-02-08 06:51:34 UTC
For RAP users, SHELL=zsh ${EPREFIX}/startprefix launches a login zsh in prefix, but the PATH does not contain the host paths like "/usr/bin". This behavior is different from bash.

It turns out the PATH sanity check in ${EPREFIX}/etc/zsh/zprofile is replacing PATH with ROOTPATH which does not contain host paths:

if [[ "${EUID}" = "1000" ]] || [[ "${USER}" = "root" ]] ; then
        # Check to make sure ROOTPATH is sane before we use it.
        # https://bugs.gentoo.org/656400
        if [[ -n ${ROOTPATH} ]] && [[ :${ROOTPATH}: == *:"/fast/prefix_bootstrap_test/gentoo"/usr/sbin:* ]] ; then
                PATH="${ROOTPATH}"
        fi
fi

This degrades the prefix experience of root and EUID=1000 users.
Comment 1 Mike Gilbert gentoo-dev 2024-02-08 13:08:10 UTC
zprofile should be updated to no reference ROOTPATH. It’s an obsolete concept.
Comment 2 Yiyang Wu 2024-02-08 14:41:54 UTC
(In reply to Mike Gilbert from comment #1)
> zprofile should be updated to no reference ROOTPATH. It’s an obsolete
> concept.

Agree.

However, https://github.com/gentoo/gentoo/pull/35225 should still be discussed, considering other legacy packages
Comment 3 Mike Gilbert gentoo-dev 2024-02-08 15:31:38 UTC
(In reply to Yiyang Wu from comment #2)
> However, https://github.com/gentoo/gentoo/pull/35225 should still be
> discussed, considering other legacy packages

Agreed.
Comment 4 Larry the Git Cow gentoo-dev 2024-02-08 17:34:18 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3443c73d1b54989a1abb11005b30416606357534

commit 3443c73d1b54989a1abb11005b30416606357534
Author:     Yiyang Wu <xgreenlandforwyy@gmail.com>
AuthorDate: 2024-02-08 14:46:17 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2024-02-08 17:30:46 +0000

    app-shells/zsh: zprofile: remove using ROOTPATH which is deprecated
    
    Now PATH also contains sbin paths, which make ROOTPATH unnecessary for
    root and uid=1000 user.
    
    Closes: https://bugs.gentoo.org/924032
    Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/35229
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 app-shells/zsh/files/zprofile-5  |  24 ++++
 app-shells/zsh/zsh-5.9-r6.ebuild | 245 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 269 insertions(+)
Comment 5 Larry the Git Cow gentoo-dev 2024-02-08 17:37:16 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2334eb2d0b76ee113e0bf438c6e719a90c95b235

commit 2334eb2d0b76ee113e0bf438c6e719a90c95b235
Author:     Yiyang Wu <xgreenlandforwyy@gmail.com>
AuthorDate: 2024-02-08 07:39:02 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2024-02-08 17:36:16 +0000

    sys-apps/baselayout: ROOTPATH should have host paths on Prefix
    
    Same as PATH, ROOTPATH should be modified to contain host paths. This
    fixes app-shells/zsh not having host paths when EUID=1000 or root user,
    because it sets ROOTPATH as PATH in /etc/zsh/zprofile, which make zsh's
    behavior align with bash.
    
    Closes: https://bugs.gentoo.org/924032
    Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/35225
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 .../{baselayout-2.14-r1.ebuild => baselayout-2.14-r2.ebuild}           | 3 ++-
 sys-apps/baselayout/baselayout-9999.ebuild                             | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)