[rancid] #' in my login banner

Per-Olof Olsson peo at chalmers.se
Wed Dec 11 18:14:12 UTC 2013


Hello




On 12/11/2013 06:51 PM, Alan McKinnon wrote:
> I see no-one has responded with an answer to your question.
> 
> I think the reason is that code cannot deal with ">" and "#" characters
> in a banner in any sane way that gives consistent results. For rancid to
> function properly, it has to know what the shell prompt is exactly for a
> given device, and to do that it has to parse the entire text output.
> 
> The only tool available to detect the prompt is pattern matching which
> inevitably means a regex. As a perl regex this is
> 
> ^[-a-zA-Z0-9]*[>#]
> 
> and that's assuming the prompt is the hostname.

In hlogin I added

	-re "\[#>]+.*\[\n\r]+" {
		exp_continue
	}

to just pass over none prompter # and >.
Banner "#" and ">" is followed by CR or NL!

Works for HPs

/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