[rancid] Re: user wich is running rancid-run [suggestion]

john heasley heas at shrubbery.net
Tue Sep 22 14:59:29 UTC 2009

Tue, Sep 22, 2009 at 12:29:02PM +0200, Diego Ercolani:
> I would like to suggest developer to make a little check in script invoking 
> rancid tools that are going to modify filesystem: rancid-run, rancid-cvs 
> The issue:
> ==========
> In my installation as (i think) the others, rancid is the user which normally 
> invoke these tools.
> For an error I invoked rancid-run as root and what I obtained was that the 
> repository was modified in such a manner that:
> 1. all the router configuration has been deleted  as svn didn't find directory 
> under the root homepage
> 2. I had to change the owner of every file back to rancid, re-invoke rancid-
> run as user and then all have been reinitialized.
> The Solution:
> =============
> Can be only a little prehamble in rancid-run and rancid-cvs scripts that 
> verify the user which is running scripts:
> example:
> >>>>>>>>>>>>>CUT>>>>>>>
> CORRECT_USER="rancid"
> if [ "$USER" != "$CORRECT_USER" ]; then
>   echo "User $USER is not allowed to run $0!" >&2
>   echo "Please invoke $0 as user $CORRECT_USER" >&2
> fi
> <<<<<<<<CUT<<<<<<<<<<<<<

thanks, but that may not be username other choose and it is entirely
reasonable that any user on a system might like to run their own

> this could be a little modification that should save some headache...
> Thank you
> Diego

More information about the Rancid-discuss mailing list