On 4 February 2010 17:14, Ed Greshko <Ed.Greshko@greshko.com> wrote:
> suvayu ali wrote:
>> On 4 February 2010 16:13, Tom Horsley <email@example.com> wrote:
>>> On Thu, 4 Feb 2010 16:00:39 -0800
>>> suvayu ali wrote:
>>>> As far as I understand this, sudo still uses your (the regular user's)
>>> Nope, that's merely what the docs claim. In fact, the security geeks
>>> decided sudo absolutely needed to have a hard coded PATH and as far
>>> as I know the only way to fix that is to rebuild it from source. It
>>> has been like this for a while now.
>> Are you sure? I tried this after your post on my lab machine (not
>> Fedora though, its Ubuntu 9.04)
>> $ sudo echo $PATH
>> [sudo] password for suvayu:
>> I see two different directories that I add to $PATH in my
>> .bash_profile and .bashrc
>>> Maybe you could create an alias that runs sudo env PATH=$PATH "$@"
>>> or something to sneak the path back into the sudo'ed command...
>> That Bugzilla says updates have been pushed to F10. Shouldn't that
>> mean its fixed in F11 and F12?
> I think you miss one thing....
> When you do "sudo echo $PATH" *$PATH is expanded before the sudo command
> is executed since it is an argument to the sudo command.
> To demonstrate what Tom is saying you need to prevent $PATH from being
> expanded by using sudo sh -c 'echo $PATH'
> As in...
> [egreshko@f12 ~]$ sudo sh -c 'echo $PATH'
Ah! that explains it. Thanks!
Open source is the future. It sets us free.
users mailing list
To unsubscribe or change subscription options: