Bug 391 - prefix_path or append_path
prefix_path or append_path
Status: NEW
Product: Sudo
Classification: Unclassified
Component: Sudo
1.7.2
PC Linux
: low enhancement
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-02-01 22:44 MST by DJ Lucas
Modified: 2010-02-01 22:44 MST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description DJ Lucas 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.