[drraw-users] Suggestion: change follow=>1 to follow_fast=>1 to allow for symlinking of directories

Max perldork at webwizarddesign.com
Sun Apr 19 13:17:28 MDT 2009


Here is a patch against SVN trunk that adds symlink_behavior to the
CGI file and a commented out variant in the .conf file with options to
show users what other options exist.

Regards,
Max

===================================================================
Index: drraw.cgi
--- drraw.cgi	(revision 1572)
+++ drraw.cgi	(working copy)
@@ -79,6 +79,11 @@
 $header = '';
 $footer = '';

+# Follow by default; this will die with an error
+# if multiple names exist for the same directory;
+# other options are follow_fast and follow_skip
+my $symlink_behavior = 'follow';
+
 # *.rrd and *.evt file list sorting function
 sub datafnsort {
     if ( defined(&mydatafnsort) ) {
@@ -2621,7 +2626,7 @@
     @rrdfiles = ();
     @evtfiles = ();
     alarm(0); # This may take a while, and that'd be okay..
-    find({wanted=>\&DBFinder, no_chdir=>1, follow=>1,
+    find({wanted=>\&DBFinder, no_chdir=>1, $symlink_behavior => 1,
           untaint=>1, # Untaint, lame...
           untaint_pattern=>qr|^([-+@\w./:]+)$|}, keys(%datadirs));
     alarm($maxtime);
Index: drraw.conf
===================================================================
--- drraw.conf	(revision 1572)
+++ drraw.conf	(working copy)
@@ -52,6 +52,13 @@
 # Minimum dashboard automatic refresh timer (seconds)
 #$drefresh = 1800;

+#  Change symlink behavior from the default behavior when finding
+#  RRD data directories; default is to die if multiple names for
+#  the same directory are found.  Other choices are 'follow_fast,'
+#  which allows for multiple names for the same directory to
+#  exist, and 'follow_skip,' which ignores any multiples.
+#$symlink_behavior = 'follow_fast';
+
 # Default Views and their names
 #@dv_def  = ( 'end - 28 hours', 'end - 1 week', 'end - 1 month', 'end
- 1 year' );
 #@dv_name = ( 'Past 28 Hours', 'Past Week', 'Past Month', 'Past Year' );



More information about the drraw-users mailing list