Extreme empty files, Bug Found???

john heasley heas at shrubbery.net
Thu Feb 14 18:37:39 UTC 2002


Thu, Feb 14, 2002 at 01:10:40PM -0500, Pierre Belanger:
> Hi all,
> 
> I posted a message a few weeks ago about Extreme configuration "empty"
> file submitted once and a while in the CVS. Check my telnet session on
> an Extreme switch.
> 
>   $ telnet ny50ext003
>   {snip}
>   * NY50EXT003:1 # exit
>    Do you wish to save your configuration changes? (y/n) nConnection
> closed
> 
> According to clogin line 545 (latest version) :
> 
> expect {
>   "Do you wish to save your configuration changes" {
>     send "n\r"
>     exp_continue
>   }
>   "\n" { exp_continue }
>   timeout { return 0 }
>   eof { return 0 }
> }
> 
> 
> If the above code works great, what about the following code from
> xrancid:
> 
> if (/$prompt\s?(quit|exit|Connection closed)/ && $found_end) {
>   $clean_run=1;
>   last;
> }
> 
> Correct me if I am wrong, I am ok in Expect but I am not a Perl guru.
> The above will be true if the script finds the prompt with a space
> and quit or exit or Connection closed ... on the same line, right?
> 
> If this is true, my previous telnet session is showing :
> 
>   Do you wish to save your configuration changes? (y/n) nConnection
> closed
> 
> There's no match with the previous if condition, right?

my guess is that the connection is being broken occassionally not at
the end.  among the problems with the extreme UI, is that
	1) it doesnt always echo the 'exit' or the following return,
	   hence the match of 'connection closed'
	2) sometimes exit is echo'd back as quit (or was it the other
	   way around?).

you could try changing that line in perl.  that should fix the premature
connection closed being interpretted as a successful collection:

if (/$prompt\s?(quit|exit)/ && $found_end) {

i havent tested this.  a hack is probably needed.



More information about the Rancid-discuss mailing list