[sudo-users] Sudo 1.6.8p12

donald.ritchey at exeloncorp.com donald.ritchey at exeloncorp.com
Tue Jan 16 13:23:34 EST 2007


In the example given, the command should be:

	sudo -u oracle8 'echo $HOME'

The single quotes around the command tell the shell to delay processing 
the environment variables until later.  The shell spawned by the 
"sudo -u oracle" portion of the command will then be owned by oracle,
with 
the HOME value now set to the 'oracle' user's home directory.

As shown in the original example, the HOME environment variable was 
expanded in the current user's shell with its value, not oracle's.

Best wishes,

Don Ritchey
Exelon Corporation IT.


-----Original Message-----
From: sudo-users-bounces at courtesan.com
[mailto:sudo-users-bounces at courtesan.com] On Behalf Of Cliff Nadler
Sent: Friday, January 12, 2007 10:20 AM
To: Buffum, Charles
Cc: sudo-users at sudo.ws
Subject: Re: [sudo-users] Sudo 1.6.8p12


Shell escape processing would happen before sudo is called, so the $HOME
is being processed by the shell before it calls sudo.

Try putting $HOME in single quotes, or change the $ to \$

On Fri, 2007-01-12 at 10:45 -0500, Buffum, Charles wrote:
> I have a question on this version - I pulled down this version from
the
> web, configured and installed it on a our development machine which is
> running AIX 5.2.0.0-08.
>  
> The configure was run as this: 
>  
> ./configure --enable-shell-sets-home --enable-log-host   
>  
> 
> I set up my sudoers file and tested, the sudo.log shows the entry for
> the host as in the (--enable-log-host) entry above however the
> --enable-shell-sets-home does not seem to work.
>  
> I tested this vi doing the following:  sudo -u oracle8 echo $HOME
>  
> Jan 11 15:54:11 : cbuffum : HOST=tblusr02 : TTY=pts/0 ;
> PWD=/var/adm/sudo/sudo-1.6.8p12 ; USER=oracle8 ; COMMAND=/usr/bin/ksh
> print
> /home/cbuffum
>  
> I was assuming that this should show me the oracle8 home path, it did
> not, it returned my home path - is there something I have missed? Is
> there more to it than just the entry at the time configure is run?
Some
> entry needed in the sudoers file? I have tried several attempts to get
> this to work and check the web for pieces I may have missed.
>  
> Any information will be appreciated,
>  
> Thanks - Charlie 
> ____________________________________________________________ 
> sudo-users mailing list <sudo-users at sudo.ws>
> For list information, options, or to unsubscribe, visit:
> http://www.sudo.ws/mailman/listinfo/sudo-users
> 
-- 
Cliff Nadler  |  Senior DBA
Services Division - MTI Technology Corporation
voice: 512-263-5500  |  fax: 512-263-0606  
web: www.mti.com

____________________________________________________________ 
sudo-users mailing list <sudo-users at sudo.ws>
For list information, options, or to unsubscribe, visit:
http://www.sudo.ws/mailman/listinfo/sudo-users

-----------------------------------------
**************************************************
This e-mail and any of its attachments may contain Exelon
Corporation proprietary information, which is privileged,
confidential, or subject to copyright belonging to the Exelon
Corporation family of Companies.
This e-mail is intended solely for the use of the individual or
entity to which it is addressed.  If you are not the intended
recipient of this e-mail, you are hereby notified that any
dissemination, distribution, copying, or action taken in relation
to the contents of and attachments to this e-mail is strictly
prohibited and may be unlawful.  If you have received this e-mail
in error, please notify the sender immediately and permanently
delete the original and any copy of this e-mail and any printout.
Thank You.
**************************************************





More information about the sudo-users mailing list