Problems with RE matching in .cloginrc

Dylan Hall dylan.hall at tsnz.net
Tue Oct 16 05:31:36 UTC 2001


The problem also occurs with jlogin 2.1 and 2.2b8 (my xlogin was derived from jlogin 2.1).

I beleave the problem is the way that jlogin looks up the password. From jlogin 2.1:

1    # Figure out loginname's password (if different from the vty password)
2    if {[info exists userpswd]} {
3      # command line passwd
4      set passwd $userpswd
5    } else {
6      set passwd [lindex [find password $loginname@$router] 0]
7      if { "$passwd" == "" } { set passwd [lindex [find password $router] 0] }
8    }

The find on line 6 matches the wildcard in .cloginrc instead of the match on line 7.

The workaround is to remove the check for $loginname@$router from jlogin. Can you suggest a more elegant fix?

Thanks,

-- 
Dylan Hall
IP Engineer
TelstraSaturn Ltd
Ph: +64 4 9395000 Fax: +64 4 9228555



john heasley wrote:
> 
> this is for extreme switches?  if so, please try clogin in 2.2b8.
> 
> Tue, Oct 16, 2001 at 11:59:36AM +1300, Dylan Hall:
> > We're having some problems getting the .cloginrc file to do what we want. Below is an extract from the file (passwords changed). The idea is that we have some wildcard entries to catch most of our switches, but a couple of more specific matches where they differ.
> >
> > #
> > # Edge Switches.....
> > #
> > add method s3-BNZW01-r01.engops.tsnz.net      {ssh}
> > add user s3-BNZW01-r01.engops.tsnz.net                rancid
> > add password s3-BNZW01-r01.engops.tsnz.net    12345
> >
> >
> > add method *-r01.engops.tsnz.net              {ssh}
> > add user *-r01.engops.tsnz.net                        admin
> > add password *-r01.engops.tsnz.net            abcde
> >
> >
> > When we use xlogin (a hack of clogin or jlogin to work with Extremes - I can't remember which) the following happens
> >
> > % ./xlogin -c "show version" s3-BNZW01-r01.engops.tsnz.net
> > s3-bnzw01-r01.engops.tsnz.net
> > spawn ssh -c 3des -x -l admin s3-bnzw01-r01.engops.tsnz.net
> >
> > xlogin seems to be getting the wrong username.
> >
> > if I change the case of entries in .cloginrc so everything is lowercase as follows:
> >
> > #
> > # Edge Switches.....
> > #
> > add method s3-bnzw01-r01.engops.tsnz.net      {ssh}
> > add user s3-bnzw01-r01.engops.tsnz.net                rancid
> > add password s3-bnzw01-r01.engops.tsnz.net    12345
> >
> >
> > add method *-r01.engops.tsnz.net              {ssh}
> > add user *-r01.engops.tsnz.net                        admin
> > add password *-r01.engops.tsnz.net            abcde
> >
> >
> > % ./xlogin -c "show version" s3-bnzw01-r01.engops.tsnz.net
> > s3-bnzw01-r01.engops.tsnz.net
> > spawn ssh -c 3des -x -l rancid s3-bnzw01-r01.engops.tsnz.net
> > rancid at s3-bnzw01-r01.engops.tsnz.net's password:
> > Permission denied, please try again.
> >
> > xlogin seems to get the right username now, but is still getting the wrong password.
> >
> > Can anyone explain/fix this? Are we using wildcards in the wrong way?
> >
> > I have attached xlogin, although the functions that match passwords are unaltered.
> >
> > This problems exists on my linux box with expect version 5.31.8 and on my freebsd box with expect version 5.32.1
> >
> > Thanks for your help,
> >



More information about the Rancid-discuss mailing list