[rancid] #' in my login banner

Alan McKinnon alan.mckinnon at gmail.com
Wed Dec 11 18:24:32 UTC 2013


On 11/12/2013 20:14, Per-Olof Olsson wrote:
> 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!



Only if the banner has a surrounding box made of > or #

One can always come up with a scheme that just happens to work for
oneself because local rules specify some exact format where you can get
a regex to work for you.

That's a lot of work though. I find it easier to just change the banner.




> 
> 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
> ----------------------------------------------------------
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo/rancid-discuss
> 
> 


-- 
Alan McKinnon
alan.mckinnon at gmail.com



More information about the Rancid-discuss mailing list