Bugzilla – Bug 391
prefix_path or append_path
Last modified: 2010-02-01 22:44:07 MST
This could be specific to my own problem, but I thought I'd run it by you for review as I thought it might be useful to others as well. I find myself either setting an unprivileged user's PATH to include "/usr/sbin:sbin" which I don't like, or executing commands such as "export PATHHOLD=$PATH && PATH=$PATH:/usr/sbin:/sbin && sudo ... && export PATH=$PATHHOLD && unset PATHHOLD" Of course the obvious answer is to use the explicit path to program, however, often times when reading unfamiliar instructions, I really don't know where the resultant program will be once installed. Obviously, a certain level of trust is involved regarding my fellow editors. ;-) So anyway, I wanted to suggest adding another option to sudo...along the lines of secure_path, but a prefix of the existing PATH environment variable. I think prefix_path or append_path look nice, and would be a fairly simple addition (I believe, I haven't really looked beyond a cursory glace of env and find_path). Just a suggestion, and might even be a really bad suggestion given the security concerns, haven't really given it much thought. Actually, prefix_path could be very useful for security given certain exploits such as writing alternate executable or alias if processed before alias and existing paths, kind of an in-between secure_path and a fully inherited environment. Maybe I'll pop back in with a patch once the BLFS book is in shape again. Thanks in advance.