[rancid] Re: clogin bug setting prompt

Casey T. Deccio ctdecci at sandia.gov
Wed Feb 27 22:13:29 UTC 2008


On Wed, 2008-02-27 at 13:35 -0700, john heasley wrote:
> Not escaping the () grouping atoms for Catalyst prompts is definitely a bug,
> thanks.
> 
> I suppose not escaping the . atom is also a bug; is there a reason that you
> only applied this fix to Catalyst prompts?
> 

Only because I hadn't used and found it while working on a Catalyst
platform.  The change would be easy to implement on the other *login
scripts, but I wouldn't have any way to test it.  But I did add this to
the other case in clogin (new patch).

> As for the +?{} atoms, these simply seem inappropriate for prompts.  Just
> as '(enable)' rather offensive.  I feel inclined to suggest that the
> configuration should be fixed rather than make this change.  Is that short
> sighted?
> 

I don't know that it is reasonable to expect that an administrator will
use the +?{} atoms in the prompt.  However, it certainly is *allowable*
to use .+{}[]() (not "?") in the prompt (on Catalyst prompts anyway).  I
favor more general cases (i.e., escaping any atoms), but that's just my
opinion FWIW.

Regards,
Casey
-------------- next part --------------
--- clogin.in	2008-02-27 14:07:27.000000000 -0800
+++ clogin.in.new	2008-02-27 13:54:14.000000000 -0800
@@ -747,11 +747,11 @@
 				  set platform "extreme"
 				}
 	-re "^.+$prompt"	{ set junk $expect_out(0,string);
-				  regsub -all "\[\]\[]" $junk {\\&} prompt;
+				  regsub -all "\[\]\[\(\)+.{}]" $junk {\\&} prompt;
 				}
 	-re "^.+> \\\(enable\\\)"	{
 				  set junk $expect_out(0,string);
-				  regsub -all "\[\]\[]" $junk {\\&} prompt;
+				  regsub -all "\[\]\[\(\)+.{}]" $junk {\\&} prompt;
 				}
     }
 


More information about the Rancid-discuss mailing list