[ic] Status of server error generating bug in rpc mode?

Mike Heins interchange-users@interchange.redhat.com
Fri Nov 16 00:22:01 2001


Quoting interch (interch@client.paymentonline.com):
> The problem appears to be that when you reference a database, this time in
> a loop tag using fi=db, that table gets added to the list of databases IC
> thinks is valid.  dummy_database loops through all of those, and dies when
> it runs into one that isn't defined.  The only place I have found the
> offending code so far is in lib/UI/pages/admin/template_edit.html in the
> code I posted in the last message.  Just go in and change fi=backup to
> fi=someothername, then go to content->template edit, edit a template, and
> save it.  You should get the error at that point, and then after that
> click on admin and you will see someothername listed as an IC table..
> 
> If not running in pre fork mode this doesn't happen.  From here I am
> pretty lost, not knowing the internals of IC I'm not really sure where to
> start looking next without spending a lot of time.
> 

Thank you, Chris. Very much. Your analysis put me onto it straightaway.

Shows to go you that you can learn something new every day. I never
thought Perl auto-vivified hash keys on a "defined" check, but now
I know different. It must do a depth-first search, autovififying
on the way.

It is a simple one-line patch to Scan.pm:

Index: Scan.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/Scan.pm,v
retrieving revision 2.0
diff -u -r2.0 Scan.pm
--- Scan.pm	2001/07/18 02:23:14	2.0
+++ Scan.pm	2001/11/16 05:19:19
@@ -894,7 +894,7 @@
 		}
 		if($_ !~ /\./) {
 			$_ = $Vend::Cfg->{Database}{$_}{'file'}
-				if defined $Vend::Cfg->{Database}{$_}{'file'};
+				if defined $Vend::Cfg->{Database}{$_};
 		}
 		$ok &&= $_ !~ /$Vend::Cfg->{NoSearch}/
 			if $Vend::Cfg->{NoSearch};

This has been a long-running problem, and you are responsible
for fixing it more than I am. 8-) If you will send me your name
I will make sure you get proper credit.

I hope you stick around. We can use you. 8-)

-- 
Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH  45013
phone +1.513.523.7621      <mheins@redhat.com>

Friends don't let friends use Outlook. -- Bob Blaylock