Summary: | app-admin/sudo: PATH values from profile.env may be ignored in merge-usr | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | konsolebox <konsolebox> |
Component: | Current packages | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | gentoo, konsolebox |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 690294 |
Description
konsolebox
2024-09-06 05:14:24 UTC
I'm not sure what you are trying to say here. Please restate. I got a bit confused. It's not PATH that's ignored here but ROOTPATH. For the sake of explanation, the relevant code can be simplified to: ``` SECURE_PATH=$(unset ROOTPATH; . "${EPREFIX}"/etc/profile.env; echo "${ROOTPATH}") if [[ ${SECURE_PATH} != */usr/sbin/* ]]; then SECURE_PATH=$(unset PATH; . "${EPREFIX}"/etc/profile.env; echo "${PATH}") fi ``` In a merge-usr system, `[[ ${SECURE_PATH} != */usr/sbin/* ]]` is always false and ROOTPATH is never used. That's the issue. The src_prepare snippet I gave is part of a sys-apps/baselayout ebuild. It strips /usr/sbin and /sbin from the generated values saved in /etc/env.d/50baselayout, which includes values of ROOTPATH and PATH, when system is not split-usr. I hope I elaborated enough. I mean [[ ${SECURE_PATH} != */usr/sbin/* ]] is always true sorry. Already negated. I thought ROOTPATH had been deprecated a long time ago since it was decided at some point that dividing binaries between "bin" and "sbin" is too arbitrary, which is also why merged-usr merges those directories as well. In other words, sudo shouldn't need to use ROOTPATH anyway. |