Amanda-Users

Re: user $PATH problem

2006-04-05 15:49:51
Subject: Re: user $PATH problem
From: Matt Hyclak <hyclak AT math.ohiou DOT edu>
To: amanda-users AT amanda DOT org
Date: Wed, 5 Apr 2006 15:43:01 -0400
On Wed, Apr 05, 2006 at 03:27:27PM -0400, Gene Heskett enlightened us:
> But, from the way I mentally processed the path, and I did in a message 
> to Anne, /etc/profile specifically removes /usr/local/sbin from the 
> path if the user has a non-zero uid.  It did not do that when I had 
> added it to /home/amanda/.bash_profile because I'd thrown some echo 
> $PATH's into /etc/profile just to check, so when it survived the "su - 
> amanda", I was scratching my head.  Does that not reset the root uid 
> first to that of "amanda"?  But I've too sleepy to trace that back for 
> the second time today.

On my system (CentOS 4), /etc/profile doesn't remove */sbin paths. It only
adds them for UID 0:

# Path manipulation
if [ `id -u` = 0 ]; then
        pathmunge /sbin
        pathmunge /usr/sbin
        pathmunge /usr/local/sbin
fi

(pathmunge is a fancy way to add things to the path either before or after
the existing path - consider it equivalent to PATH=$PATH:/sbin)

One way to solve this would be to create a script in /etc/profiles.d/ to do:

if [ `id -un` = "amanda" ]; then
        PATH=$PATH:/path/to/amanda/executables
fi

You could modify that to do anyone in a certain group (disk, backup, etc.),
or just stick it in .bash_profile :-)

Matt

-- 
Matt Hyclak
Department of Mathematics 
Department of Social Work
Ohio University
(740) 593-1263

<Prev in Thread] Current Thread [Next in Thread>