[mrtg] cfgmaker not quoting --if-filter in "Created by" lines

Joe Moore joseph.f.moore at ugsplm.com
Tue Nov 9 21:47:29 MET 2004


I've noticed that when I specify "--if-filter='$default_iftype'" to 
cfgmaker, the resulting cfgfile doesn't have the if-filter argument 
quoted.  (in the second line)

This plays havoc with the script I've written to re-generate the config 
files (to pick up interface alias changes, etc)

To get around this, I've added '\$' to the list of to-be-escaped 
characters for $opt{fullcmd}.  While this doesn't exactly give an 
aesthetically pleasing result (the entire --if-filter argument is 
quote-escaped), it is functionally acceptable for my script.

--Joe

--- cfgmaker.orig       Tue Nov  9 14:42:37 2004
+++ cfgmaker    Tue Nov  9 14:44:42 2004
@@ -62,7 +62,7 @@
     init();
     $opt{fullcmd} =
        "$0 ".(join " ",
-              map {$_ =~ /[ \[\]\*\{\}\;\>\<\&]/ ? "'$_'" : $_ } @ARGV);
+              map {$_ =~ /[ \[\]\*\{\}\;\>\<\&\$]/ ? "'$_'" : $_ } @ARGV);
     $opt{community}="public";
     $opt{interfaces}=1;
     options(\%opt,\%routers);

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list