Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 621400 - sys-apps/baselayout-2.4.1: empty PATH after using su/sudo
Summary: sys-apps/baselayout-2.4.1: empty PATH after using su/sudo
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal critical (vote)
Assignee: William Hubbs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-10 14:31 UTC by Michał Górny
Modified: 2017-06-10 20:11 UTC (History)
3 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 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-06-10 14:31:04 UTC
After upgrading to new baselayout, env-update, etc.:

$ . /etc/profile
$ echo $PATH
/usr/x86_64-pc-linux-gnu/gcc-bin/5.4.0:[...] [correct]
$ sudo bash
Password: 
# echo $PATH

[empty]

Same after using su.

Funny enough, commenting the bit setting PATH=${ROOTPATH} seems to fix it somehow. Direct login to root works fine. /etc/profile.env contains ROOTPATH.
Comment 1 Mike Gilbert gentoo-dev 2017-06-10 14:44:08 UTC
I can't reproduce this. Can you share your sudoers file?
Comment 2 Mike Gilbert gentoo-dev 2017-06-10 15:03:38 UTC
Also, if you have secure_path enabled (it is enabled by default), the default value of PATH gets compiled into the sudo binary.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-06-10 20:11:02 UTC
Turned out to be PEBKAC. I had an old .bashrc entry that grepped profile files for path end evaled that (probably workaround for some issue). The grep just happened to catch too much post the change.