Consolehelper and sudo (was Re: Export)
Rick Stevens
rstevens at vitalstream.com
Fri Jan 16 23:32:02 UTC 2004
William Hooper wrote:
> Bevan C. Bennett said:
>
>>su works because you end up with root's environment variables (and
>>path), thus avoiding consolehelper entirely.
>
>
> No you don't:
>
> [whooper at kenny whooper]$ su -c printenv | grep PATH
> Password:
> JAVA_PATH=/usr/java/j2re1.4.2_02
> PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/java/j2re1.4.2_02/bin:/home/whooper/bin
> [whooper at kenny whooper]$ sudo printenv | grep PATH
> JAVA_PATH=/usr/java/j2re1.4.2_02
> PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/java/j2re1.4.2_02/bin:/home/whooper/bin
>
> [whooper at kenny whooper]$ su -c "which up2date"
> Password:
> /usr/bin/up2date
> [whooper at kenny whooper]$ sudo which up2date
> /usr/bin/up2date
> [whooper at kenny whooper]$
>
> I assume they use xauth differently and that is why one works and the
> other doesn't.
"su" simply changes your UID and GID to root's. "su -" gives you root's
environment as well.
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer rstevens at vitalstream.com -
- VitalStream, Inc. http://www.vitalstream.com -
- -
- Microsoft Windows: Proof that P.T. Barnum was right -
----------------------------------------------------------------------
More information about the fedora-list
mailing list