[rancid] hrancid patch to ignore legal disclaimer

heasley heas at shrubbery.net
Wed Apr 17 18:20:40 UTC 2013


Tue, Apr 09, 2013 at 06:00:28PM +0300, Mika Tiainen:
> Hi,
> 
> We upgraded our 2610 series Procurves to R.11.98. In this software "show
> tech transceivers" (or any other "show tech" command) is prefixed with
> this funny legal disclaimer:
> 
> ,----
> | XXX# show tech transceivers 
> | ATTENTION: You are entering a diagnostic mode on this product that is HP
> | Confidential and Proprietary. This mode, the commands and functionality
> | specific to this mode, and all output from this mode are HP Confidential
> | and Proprietary. You may use this mode only by specific permission of, and
> | under the direction of, an HP support engineer or HP technical engineer.
> | Unauthorized or improper use of this mode will be considered by HP to be
> | unauthorized modification of the product, and any resulting defects or
> | issues are not eligible for coverage under the HP product warranty or any
> | HP support or service.  UNAUTHORIZED OR IMPROPER USE OF THIS MODE CAN
> | MAKE THE PRODUCT COMPLETELY INOPERABLE.
> | 
> | 
> | transceivers
> | 
> | Transceiver Technical Information: 
> |  Port # |   Type    | Prod # | Serial #        | Part # 
> `----
> 
> I assume that, in some future update, it might get added to other
> Procurve software families too. Here is a small patch for hrancid to
> ignore the disclaimer part in "show tech tranceivers" output:
> 

> --- hrancid.orig	2013-01-30 18:20:15.000000000 +0200
> +++ hrancid	2013-04-09 10:24:54.000000000 +0300
> @@ -312,6 +312,13 @@
>  
>  	s/ Technical Information//i;
>  
> +	if (/^ATTENTION: You are entering a diagnostic mode/) {
> +	    while (<INPUT>) {
> +		tr/\015//d;
> +		last if (/^(\s*)$/);
> +	    }
> +	    next;
> +	}
>  	ProcessHistory("COMMENTS","keysort","G0",";$_");
>      }
>      return(0);

ok.  i think that the prompt should also be matched, in case it returns
nothing after the notice.  like so:

Index: bin/hrancid.in
===================================================================
--- bin/hrancid.in	(revision 2684)
+++ bin/hrancid.in	(working copy)
@@ -312,6 +312,14 @@
 	return(1) if /^(Invalid|Ambiguous) input:/i;
 
 	s/ Technical Information//i;
+	if (/^ATTENTION: You are entering a diagnostic mode/) {
+	    while (<INPUT>) {
+	    tr/\015//d;
+		return(1) if (/^$prompt/);
+		last if (/^(\s*)$/);
+	    }
+	    next;
+	}
 
 	ProcessHistory("COMMENTS","keysort","G0",";$_");
     }

thanks


More information about the Rancid-discuss mailing list