Hi
I have been going through the code example on www.perl.com
(XSP, Taglibs and Pipelines)
I noticed I get a problem with
PerlWarn On
PerlTaintCheck On
in httpd.conf.
So, when I turn PerlWarn Off and PerlTaintCheck Off it works.
Main error message:
[AxKit] [Error] Insecure dependency in eval while running with -T switch
at /usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/Language/XSP.pm
line 109.
For testing I used these
lynx -source localhost/axkit/weather1.xsp?zip=15206 | xmllint --format -
lynx -source localhost/axkit/weather1.xsp?zip=15206
Arnold
I am using
Apache 1.3.23
mod_perl 1.26
AxKit 1.52
linux 2.4.10 i686 (SuSE)
Below are
- config files
- code example files
- error message
########################################
CONFIG FILES
# startup.pl
#!/usr/bin/perl
use lib qw(/usr/local/apache/lib/modperl);
#use lib qw("/home/kampen/lib/modperl");
use Apache::Constants;
use Apache::Registry;
use Apache::RegistryLoader;
use DBI;
use CGI qw(:all);
use DirHandle;
use strict;
$Apache::Registry::NameWithVirtualHost = 0;
my $rl = Apache::RegistryLoader->new;
my $dh = DirHandle->new("/usr/local/apache/perl") or die $!;
foreach my $file ($dh->read) {
next unless $file =~ /\.(pl|cgi)$/;
#print $STDOUT "pre-loading $file\n";
$rl->handler("/perl/$file","/usr/local/apache/perl/$file");
}
1;
__END__
# perl.conf
PerlRequire conf/startup.pl
PerlInitHandler Apache::Reload
PerlSetVar ReloadAll Off
PerlSetVar ReloadTouchFile /tmp/reload_modules
#PerlWarn On
#PerlTaintCheck On
PerlModule AxKit
Alias /axkit/ /usr/local/apache/axkit/
<Location /axkit>
SetHandler perl-script
PerlHandler AxKit
AxDebugLevel 10
AxCacheDir /tmp/axkit_cache
AxStackTrace On
AxGzipOutput Off
AxAddXSPTaglib AxKit::XSP::Util
AxAddXSPTaglib AxKit::XSP::Param
AxAddXSPTaglib MyTaglibs::WeatherTaglib
AxAddStyleMap application/x-xsp Apache::AxKit::Language::XSP
AxAddStyleMap application/x-xpathscript Apache::AxKit::Language::XPathScript
AxAddStyleMap text/xsl Apache::AxKit::Language::Sablot
</Location>
<Location /axkit_articles/weather>
SetHandler perl-script
PerlHandler MyTaglibs::WeatherTaglibs
</Location>
<Location /bla>
SetHandler perl-script
PerlHandler Test::Test
</Location>
PerlModule Apache::PerlSections
<perl>
push @Alias, [ qw(/perl/ /usr/local/apache/perl/) ];
$Location{"/perl/"} = { SetHandler => "perl-script",
PerlHandler => "Apache::Registry",
Options => "+ExecCGI",
PerlSendHeader => "On",
PerlSetupEnv => "On"
};
$PerlSetVar = "Filter On" if Apache->module('Apache::Filter');
print STDERR Apache::PerlSections->dump;
</perl>
######################################################
CODE SAMPLES
weather1.xsp:
------------
<?xml-stylesheet href="NULL" type="application/x-xsp"?>
<?xml-stylesheet href="weather.xsl" type="text/xsl"?>
<?xml-stylesheet href="as_html.xsl" type="text/xsl"?>
<xsp:page language="Perl"
xmlns:xsp="http://www.apache.org/1999/XSP/Core"
xmlns:util="http://apache.org/xsp/util/v1"
xmlns:param="http://axkit.org/NS/xsp/param/v1"
xmlns:weather="http://olddog.acon.nl/axkit_articles/weather/"
>
<data>
<title><a name="title"/>Mijn weer rapportage</title>
<time>
<util:time format="%H:%M:%S:" />
</time>
<weather>
<weather:report>
<weather:zip><param:zip/></weather:zip>
</weather:report>
</weather>
</data>
</xsp:page>
weather.xsl:
-----------
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:template match="/data/time">
<time>Hi! It's <xsl:value-of select="/data/time" /></time>
</xsl:template>
<xsl:template match="/data/weather">
<weather>The weather in
<xsl:value-of select="/data/weather/city" />,
<xsl:value-of select="/data/weather/state"/> is
<xsl:value-of select="/data/weather/cond" /> and
<xsl:value-of select="/data/weather/temp" />F
(courtesy of <a href="{/data/weather/url}">The
Weather Channel</a>).
</weather>
</xsl:template>
<xsl:template match="@*|node()">
<!-- Copy the rest of the doc verbatim -->
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
as_html.xsl
-----------
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" />
<xsl:template match="/">
<html>
<head>
<title><xsl:value-of select="/data/title" /></title>
</head>
<body>
<h1><xsl:copy-of select="/data/title/node()" /></h1>
<p><xsl:copy-of select="/data/time/node()" /></p>
<p><xsl:copy-of select="/data/weather/node()" /></p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
####################################################################
ERROR MESSAGE form logs
[notice] Apache/1.3.23 (Unix) AxKit/1.52 mod_perl/1.26 configured --
resuming normal operations
[notice] Accept mutex: sysvsem (Default: sysvsem)
[warn] [client 127.0.0.1] [AxKit] handler called for /axkit/weather1.xsp
[AxKit] checking if we process this resource
[AxKit] media: screen, preferred style: #default
Use of uninitialized value in join or string at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/Cache.pm line 25.
[AxKit] Cache: key = f1e3924e8ebc61f378d51b84cb5dfec0
[AxKit] getting styles and external entities from the XML
[AxKit] styles not cached - calling $provider->get_styles()
[AxKit] using XS get_styles (libxml2)
[AxKit] calling xs_get_styles_fh()
[AxKit] calling xs_get_styles_str()
[AxKit] parse_pi: href = NULL
[AxKit] parse_pi: type = application/x-xsp
[AxKit] parse_pi: href = weather.xsl
[AxKit] parse_pi: type = text/xsl
[AxKit] parse_pi: href = as_html.xsl
[AxKit] parse_pi: type = text/xsl
Use of uninitialized value in concatenation (.) or string at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/Provider.pm line
256.
Use of uninitialized value in concatenation (.) or string at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/Provider.pm line
256.
[AxKit] xs_get_styles returned: , ,
{http://www.apache.org/1999/XSP/Core}page
Use of uninitialized value in concatenation (.) or string at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/Provider.pm line
164.
Use of uninitialized value in concatenation (.) or string at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/Provider.pm line
164.
Use of uninitialized value in concatenation (.) or string at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/Provider.pm line
164.
[AxKit] Calling GetMatchingProcessors with (screen, , , ,
{http://www.apache.org/1999/XSP/Core}page)
[AxKit] get_styles: loading style modules
[AxKit] get_styles: looking for mapping for style type:
'application/x-xsp'
[AxKit] get_styles: looking for mapping for style type: 'text/xsl'
[AxKit] get_styles: looking for mapping for style type: 'text/xsl'
[AxKit] cache doesn't exist
[AxKit] some condition failed. recreating output
[AxKit] styles: Apache::AxKit::Language::XSP(NULL)
[AxKit] styles: Apache::AxKit::Language::Sablot(weather.xsl)
[AxKit] styles: Apache::AxKit::Language::Sablot(as_html.xsl)
[AxKit] [uri] File Provider looking up uri NULL
[AxKit] [uri] File Provider set filename to /usr/local/apache/axkit/NULL
[AxKit] about to execute: Apache::AxKit::Language::XSP::handler
[AxKit] XSP: parsing fh
Use of uninitialized value in hash element at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/Language/XSP.pm
line 194.
Use of uninitialized value in hash element at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/Language/XSP.pm
line 194.
Use of uninitialized value in hash element at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/Language/XSP.pm
line 194.
Use of uninitialized value in split at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/Language/XSP/TaglibHelper.pm
line 78.
Use of uninitialized value in concatenation (.) or string at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/Language/XSP.pm
line 428.
Use of uninitialized value in concatenation (.) or string at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/Language/XSP.pm
line 428.
Use of uninitialized value in split at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/Language/XSP/TaglibHelper.pm
line 78.
Use of uninitialized value in split at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/Language/XSP/TaglibHelper.pm
line 78.
Use of uninitialized value in hash element at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/Language/XSP.pm
line 194.
Use of uninitialized value in concatenation (.) or string at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/Language/XSP.pm
line 332.
Use of uninitialized value in concatenation (.) or string at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/Language/XSP.pm
line 332.
[AxKit] Recompiling XSP script
[AxKit] Recompiling XSP script
[AxKit] package
Apache::AxKit::Language::XSP::ROOT::usr::local::apache::axkit::weather1_2exsp;
@Apache::AxKit::Language::XSP::ROOT::usr::local::apache::axkit::weather1_2exsp::ISA
= ('Apache:
:AxKit::Language::XSP::Page');
use Apache;
use Apache::Constants qw(:common);
use XML::LibXML;#initialize xsp namespace
#initialize xsp namespace
sub handler {
my ($r, $cgi, $document) = @_;
my ($parent);
{ my $elem =
$document->createElement(q|data|);$document->setDocumentElement($elem);
$parent = $elem; }
{ my $elem =
$document->createElement(q|title|);$parent->appendChild($elem); $parent =
$elem; }
{ my $elem = $document->createElement(q|a|);$parent->appendChild($elem);
$parent = $elem; }
$parent->setAttribute(q|name|,q|title|);
$parent = $parent->getParentNode;
{ my $text = $document->createTextNode(q|Mijn weer
rapportage|);$parent->appendChild($text); }
$parent = $parent->getParentNode;
{ my $elem =
$document->createElement(q|time|);$parent->appendChild($elem); $parent =
$elem; }
{
my $text = $document->createTextNode("".do {
my ($_format);$_format =
q|%H:%M:%S:|;AxKit::XSP::Util::get_date($_format)}); # non xsp tag
$parent->appendChild($text);
}
$parent = $parent->getParentNode;
{ my $elem =
$document->createElement(q|weather|);$parent->appendChild($elem); $parent
= $elem; }
{
my $text = $document->createTextNode("".do {
{ my %_args = ();
$_args{zip} = ""
. do {$cgi->param(q|zip|)};
; die 'Required arg "zip" for tag report is missing' if
not defined $_args{zip};
Apache::AxKit::Language::XSP::TaglibHelper::handle_result('report($zip)',
undef(), 0, $document, $parent,
MyTaglibs::WeatherTaglib::report($_args{zip},));}
}); # non xsp tag
$parent->appendChild($text);
}
$parent = $parent->getParentNode;
$parent = $parent->getParentNode;
return OK;
}
[AxKit] Caught an exception
[AxKit] [Error] Insecure dependency in eval while running with -T switch
at /usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/Language/XSP.pm
line 109.
[AxKit] From:
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/Exception.pm : 9
[AxKit] [Backtrace] Insecure dependency in eval while running with -T
switch at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/Language/XSP.pm
line 109.
Apache::AxKit::Exception::new('Apache::AxKit::Exception::Error',
'-text', 'Insecure dependency in eval while running with -T switch at
/usr...') called at /usr/lib/perl5/site_perl/5.
6.1/i586-linux/AxKit.pm line 722
AxKit::prep_exception('Insecure dependency in eval while running
with -T switch at /usr...') called at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/AxKit.pm line 182
AxKit::__ANON__('Insecure dependency in eval while running with -T
switch at /usr...') called at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/Language/XSP.pm
line 109
Apache::AxKit::Language::XSP::handler('Apache::AxKit::Language::XSP',
'AxKit::Apache=SCALAR(0x84bab20)',
'Apache::AxKit::Provider::File=HASH(0x84bac40)',
'Apache::AxKit::Provider::Fi
le=HASH(0x84bad18)', '') called at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/AxKit.pm line 519
AxKit::process_request('AxKit::Apache=SCALAR(0x84bab20)',
'Apache::AxKit::Provider::File=HASH(0x84bac40)', 'ARRAY(0x84ac624)')
called at /usr/lib/perl5/site_perl/5.6.1/i586-linux/AxK
it.pm line 307
eval {...} called at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/AxKit.pm line 226
AxKit::main_handler('AxKit::Apache=SCALAR(0x84bab20)',
'Apache::AxKit::Provider::File=HASH(0x84bac40)') called at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/AxKit.pm line 213
AxKit::handler('AxKit::Apache=SCALAR(0x84bab20)') called at
/dev/null line 0
eval {...} called at /dev/null line 0
Use of uninitialized value in hash element at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/ConfigReader.pm
line 237.
Use of uninitialized value in concatenation (.) or string at
/usr/lib/perl5/site_perl/5.6.1/i586-linux/Apache/AxKit/ConfigReader.pm
line 240.
[error] ErrorStylesheet: No module mapping found for type ''