[interchange-cvs] interchange - danb modified 2 files

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Fri Oct 14 20:09:29 EDT 2005


User:      danb
Date:      2005-10-15 00:09:29 GMT
Modified:  lib/Vend Config.pm
Modified:  .        WHATSNEW-5.3
Log:
* Fix bug that prevented the use of "<filename" to slurp configuration contents
  from a file.

Currently, trying to use "Directive <filename" in catalog.cfg results in
"Can't use file with NoAbsolute set".

Revision  Changes    Path
2.185     +22 -4     interchange/lib/Vend/Config.pm


rev 2.185, prev_rev 2.184
Index: Config.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Config.pm,v
retrieving revision 2.184
retrieving revision 2.185
diff -u -r2.184 -r2.185
--- Config.pm	30 Sep 2005 09:46:15 -0000	2.184
+++ Config.pm	15 Oct 2005 00:09:29 -0000	2.185
@@ -1,6 +1,6 @@
 # Vend::Config - Configure Interchange
 #
-# $Id: Config.pm,v 2.184 2005/09/30 09:46:15 docelic Exp $
+# $Id: Config.pm,v 2.185 2005/10/15 00:09:29 danb Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -52,7 +52,7 @@
 use Vend::Data;
 use Vend::Cron;
 
-$VERSION = substr(q$Revision: 2.184 $, 10);
+$VERSION = substr(q$Revision: 2.185 $, 10);
 
 my %CDname;
 my %CPname;
@@ -1724,8 +1724,26 @@
 			);
 		}
 		$file = $CDname{$lvar} unless $file;
-		$file = "$confdir/$file" unless $file =~ m!^/!;
-		$file = escape_chars($file);			# make safe for filename
+		
+		# If the file isn't already specified with an absolute path, try the 
+		# Config directory, then the current directory.  When neither file
+		# exists, use the Config directory and continue.
+		if ($file !~ m!^/!) {
+			my $test_with_confdir = escape_chars("$confdir/$file");
+			if (-f $test_with_confdir) {
+				$file = $test_with_confdir;
+			}
+			else {
+				my $test_without_confdir = escape_chars($file);
+				if (-f $test_without_confdir) {
+					$file = $test_without_confdir;
+				}
+				else {
+					$file = $test_with_confdir;
+				}
+			}
+		}
+		 
 		my $tmpval = readfile($file);
 		unless( defined $tmpval ) {
 			config_warn(



2.19      +3 -0      interchange/WHATSNEW-5.3


rev 2.19, prev_rev 2.18
Index: WHATSNEW-5.3
===================================================================
RCS file: /var/cvs/interchange/WHATSNEW-5.3,v
retrieving revision 2.18
retrieving revision 2.19
diff -u -r2.18 -r2.19
--- WHATSNEW-5.3	24 Jan 2005 14:38:59 -0000	2.18
+++ WHATSNEW-5.3	15 Oct 2005 00:09:29 -0000	2.19
@@ -60,6 +60,9 @@
 * Controlling Interchange (add,remove,jobs) doesn't stop despite of a 
   stale PID file and kills the script it runs from (Debian bug #256093)
 
+* Fix bug that prevented the use of "<filename" to slurp configuration contents
+  from a file.
+  
 UI
 --
 








More information about the interchange-cvs mailing list