[rancid] Two suggestions about rancid-3.3.0

Tetsuo Handa penguin-kernel at I-love.SAKURA.ne.jp
Tue Feb 16 10:03:17 UTC 2016


heasley wrote:
> Tue, Feb 09, 2016 at 07:30:16PM +0900, Tetsuo Handa:
> > Hello.
> > 
> > I just looked at rancid-3.3.0.tar.gz and noticed two bugs.
> > 
> > Bug1: . is not removed from PATH in the following four files.
> > 
> >   /usr/local/rancid-3.3/etc/lg.conf
> >   $ENV{PATH}="/usr/local/rancid-3.3/bin:/usr/bin:/usr/sbin:/bin:.:/usr/local/bin:/usr/bin";
> > 
> >   /usr/local/rancid-3.3/etc/rancid.conf
> >   PATH=/usr/local/rancid-3.3/bin:/usr/bin:/usr/sbin:/bin:.:/usr/local/bin:/usr/bin; export PATH
> > 
> >   /usr/local/rancid-3.3/share/rancid/lg.conf.sample
> >   $ENV{PATH}="/usr/local/rancid-3.3/bin:/usr/bin:/usr/sbin:/bin:.:/usr/local/bin:/usr/bin";
> > 
> >   /usr/local/rancid-3.3/share/rancid/rancid.conf.sample
> >   PATH=/usr/local/rancid-3.3/bin:/usr/bin:/usr/sbin:/bin:.:/usr/local/bin:/usr/bin; export PATH
> 
> It properly filters the path for me.  Please send the config.log to me.
> 

My environment does not have rsh and telnet.

----------
# grep ac_cv_path_ config.log
ac_cv_path_COMM=/usr/bin/comm
ac_cv_path_CVS=/usr/bin/cvs
ac_cv_path_DIRNAME=/usr/bin/dirname
ac_cv_path_EGREP='/bin/grep -E'
ac_cv_path_EXPECT_PATH=/usr/bin/expect
ac_cv_path_FIND=/bin/find
ac_cv_path_GREP=/bin/grep
ac_cv_path_ID=/usr/bin/id
ac_cv_path_MAKE=/usr/bin/gmake
ac_cv_path_MKDIR=/bin/mkdir
ac_cv_path_MKTEMP_PATH=/bin/mktemp
ac_cv_path_PERLV_PATH=/usr/bin/perl
ac_cv_path_PING_PATH=/bin/ping
ac_cv_path_RSH=no
ac_cv_path_SENDMAIL=/usr/sbin/sendmail
ac_cv_path_SORT=/bin/sort
ac_cv_path_SSH=/usr/bin/ssh
ac_cv_path_TELNET=no
ac_cv_path_TOUCH=/bin/touch
ac_cv_path_install='/usr/bin/install -c'
ac_cv_path_mkdir=/bin/mkdir
----------

Passing "no" to dirname command returns ".".

----------
# dirname no
.
----------

Therefore, unconditional concatenation results in "." in ENV_PATH.

ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_RSH`"
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_TELNET`"

Like I suggested on Fri, 5 Jun 2015 20:45:38 +0900,
you can later filter "." from ENV_PATH.


More information about the Rancid-discuss mailing list