[rancid] Re: Rancid stopped working for my HP switches

Per-Olof Olsson peo at chalmers.se
Wed Apr 14 09:45:06 UTC 2010


Per-Olof Olsson wrote:

Sorry

Didn't say that if you replace "exit" with "logout" in hlogin.
hrancid also have to get a new line to trig "clean run"

hransid.in
...
TOP: while(<INPUT>) {
    tr/\015//d;
    if (/$prompt\s*exit\s*$/i) {
        $clean_run=1;
        last;
    }

# Test to trig clean run from "logout"
    if (/Do you want to log out/i) {
      $clean_run=1;
      last;
    }


EXIT-----raw
...
^M^M
^Mmy-switch#exit^M^M
my-switch> exit^M^M
Do you want to log out [y/n]? y^M^M
Connection to my-switch closed.^M^M^M
-------------

LOGOUT----raw
....
^M^M
^Mmy-switch#logout^M^M
Do you want to log out [y/n]? y^M^M
Do you want to save current configuration [y/n]?  n^M^M
Connection to my-switch closed.^M^M^M
-------------





> 
> 3:
> I also notice that the hlogin -S option (save running config on exit) is
> not working!
> There was a security issue about that operator was able to save config
> file...
> 
> If you like to get to the "save current configuration"-question, you
> have to run "logout" from manager level.
> 
> 
> ---------------------------------------------------------------
> diff -c hlogin.in.ORG+1 hlogin.in
> *** hlogin.in.ORG+1     Mon Apr 12 07:54:40 2010
> --- hlogin.in   Mon Apr 12 16:36:15 2010
> ***************
> *** 221,229 ****
>             set avenable 0
>         # Does tacacs automatically enable us?
>         } -autoenable {
> !           # hp does not autoenable
> !           #set autoenable 1
> !           #set avenable 0
>         } -* {
>             send_user "\nError: Unknown argument! $arg\n"
>             send_user $usage
> --- 221,228 ----
>             set avenable 0
>         # Does tacacs automatically enable us?
>         } -autoenable {
> !           set avautoenable 1
> !           set avenable 0
>         } -* {
>             send_user "\nError: Unknown argument! $arg\n"
>             send_user $usage
> ***************
> *** 432,438 ****
>         }
>         -re "Enter passphrase.*: " {
>             # sleep briefly to allow time for stty -echo
> !           sleep 1
>             send -- "$passphrase\r"
>             exp_continue
>         }
> --- 431,437 ----
>         }
>         -re "Enter passphrase.*: " {
>             # sleep briefly to allow time for stty -echo
> !           sleep 2
>             send -- "$passphrase\r"
>             exp_continue
> ***************
> *** 564,570 ****
>         }
>       }
>       log_user 1
> !     send -h "exit\r"
>       expect {
>         "Do you want to save current configuration"     {
>                                                   if {$do_saveconfig} {
> --- 563,569 ----
>         }
>       }
>       log_user 1
> !     send -h "logout\r"
>       expect {
>         "Do you want to save current configuration"     {
>                                                   if {$do_saveconfig} {
>                                                  if {$do_saveconfig} {
> ------------------------------------------


/Peo
----------------------------------------------------------
Per-Olof Olsson               Email: peo at chalmers.se
Chalmers tekniska högskola    IT-service
Hörsalsvägen 5                412 96 Göteborg
Tel: 031/772 6738  Fax: 031/772 8660
----------------------------------------------------------


More information about the Rancid-discuss mailing list