[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#69090: [taprogge@idg.rwth-aachen.de: Re: Bug#69090: strange su / which / apt behaviour]



again: forgot

----- Forwarded message from Jens Taprogge <taprogge@idg.rwth-aachen.de> -----

Date: Mon, 14 Aug 2000 00:17:02 -0700
From: Jens Taprogge <taprogge@idg.rwth-aachen.de>
To: Adrian Bunk <bunk@fs.tum.de>

On Mon, Aug 14, 2000 at 04:18:32AM +0200, Adrian Bunk wrote:
> You are looking for "su -".
> 
> From the su man page:
>  
>        su  is used to become another user during a login session.
>        Invoked without a username, su defaults  to  becoming  the
>        super  user.   The optional argument - may be used to pro-
>        vide an environment similiar to what the user would expect
>        had the user logged in directly.

Still the PATH should be set to contain the sbin directories.
>From the manpage: 
       The  current  environment is passed to the new shell.  The
       value of $PATH is reset to /bin:/usr/bin for normal users,
       or /sbin:/bin:/usr/sbin:/usr/bin for the super user.  This
       may  be  changed  with   the   ENV_PATH   and   ENV_SUPATH
       definitions  in  /etc/login.defs.  When using the -m or -p
       options, the users environment is not changed.
In /etc/login.defs the paths are set to:
ENV_SUPATH      PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11:/usr/local/sbin:
/usr/local/bin
ENV_PATH        PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games

As you can see from my original message the PATH does contain the sbin
directories (plus some extra ones). 

Or is it not the PATH that matters?

> 
> 
> > Now when I use sudo things seem to be normal:
> > 
> > $ sudo which ldconfig
> > /sbin/ldconfig
> > $
> > 
> > 
> > On the other hand:
> > 
> > $ sudo -s
> > # which ldconfig
> > #
> >...
> 
> sudo gives you only root permissions, but you aren't logged in as
> root. That means your PATH is set to the PATH of your user account.
So why does 'sudo which ldconfig' work?
> 
> 
> > Best Regards
> >   Jens
> 
> cu,
> Adrian

Best Regards 
Jens

-- 
Jens Taprogge


----- End forwarded message -----




Reply to: