Apache-ASP
view release on metacpan or search on metacpan
# for the FileId otherwise
my $package = $global_asa->{'package'}.'::'.&FileId($self, $self->{basename}, $self->{filename});
$self->{'package'} = $package;
$self->{init_packages} = ['main', $global_asa->{'package'}, $self->{'package'}];
} else {
$self->{'package'} = $global_asa->{'package'};
$self->{init_packages} = ['main', $global_asa->{'package'}];
}
$self->{state_dir} = &config($self, 'StateDir', undef, $self->{global}.'/.state');
$self->{state_dir} =~ tr///; # untaint
# if no state has been config'd, then set up none of the
# state objects: Application, Internal, Session
unless(&get_dir_config($dir_config, 'NoState')) {
# load at runtime for CGI environments, preloaded for mod_perl
require Apache::ASP::StateManager;
&InitState($self);
}
$self;
# we load this module just to detect where the shared directory really is
use Apache::ASP::Share::CORE;
# major problem with %INC if we cannot get this information
my $share_path = $INC{'Apache/ASP/Share/CORE.pm'}
|| die(q(can't find path for $INC{'Apache/ASP/Share/CORE.pm'}));
$share_path =~ s/CORE\.pm$//s;
unless($share_path =~ /$AbsoluteFileMatch/) {
# this %ENV manipulation is just to allow cwd() to run in taint check mode
local %ENV = %ENV;
$ENV{PATH} = '/bin:/usr/bin:/usr/sbin';
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
my $currdir = cwd();
$share_path = "$currdir/$share_path";
}
# not finding the ShareDir creates a hard error, because the Apache/ASP/Share
# directory will become one of the fundamental underpinings of the project
# People will need to rely on being able to load shared includes, and not have
# relative to some directory. This was needed to have the "make test"
# test suite to work which loads libraries from "blib/lib", but Apache::ASP
# will chdir() into the script directory so that can ruin this
# library lookup.
#
my $lib_path = $share_path;
$lib_path =~ s/Apache.ASP.Share.?$//s;
-d $lib_path || die("\%INC library path $lib_path not found.");
$INCDir = $lib_path;
# clear taint, for some reason, tr/// or s/^(.*)$/ did not work on perl 5.6.1
$INCDir =~ /^(.*)$/s;
$INCDir = $1;
# make sure this gets on @INC at startup, can't hurt
eval "use lib qw($INCDir);";
1;
}
sub FileId {
$self->{compile_perl_count}++; # counter used in test case closure.t
my $eval =
join(" ;; ",
"package $package;", # for no sub closure
"sub $subid { ",
"package $package;", # for sub closure
$$script,
'}',
);
# $eval =~ tr///; # untaint
$eval =~ /^(.*)$/s;
$eval = $1;
my $sub_ref;
if($self->{use_strict}) {
local $SIG{__WARN__} = sub { die("maybe use strict error: ", @_) };
# comment out for now, until 3.0 release for this may create lots
# of compile time errors for people that will need to fix scripts
if($LoadModuleErrors{$category}) {
$self->Error("cannot load $_ for $category: $LoadModuleErrors{$category}; $@");
} else {
$self->Debug("already failed to load $_");
}
$load_errors++;
}
next;
}
$_ =~ tr///; # untaint
eval "use $_";
if($@) {
if($LoadModuleErrors{$category}) {
$self->Error("cannot load $_ for $category: $LoadModuleErrors{$category}; $@");
} else {
# don't wan't Log() output for make test when optional modules aren't installed
# is not installed, --jc 6/11/2001
$self->Debug("cannot load $_ for $category: $@");
}
$load_errors++;
+Added some extra help text to the ./cgi/asp --help message
to clarify how to pass arguments to a script from the command line.
+When using $Server->Mail() API, if Content-Type header is set,
and MIME-Version is not, then a "MIME-Version: 1.0" header will be sent
for the email. This is correct according to RFC 1521 which specifies
for the first time the Content-Type: header for email documents.
Thanks to Philip Mak for pointing out this correct behavior.
+Made dependent on MLDBM::Sync version .25 to pass the taint_check.t test
+Improved server_mail.t test to work with mail servers were relaying is denied
+Added <html><body> tags to MailErrorsTo email
--Fixed SessionCount / Session_OnEnd bug, where these things were not
working for $Sessions that never had anything written to them.
This bug was introduced in 2.23/2.25 release.
There was an optimization in 2.23/2.25 where a $Session that was never
Added a test at ./t/session_events.t for these things.
+Some optimizations for $Session API use.
+Added support for XSLT via XML::LibXSLT, patch courtesy of Michael Buschauer
-Got rid of an warning when recompiling changing includes under perl 5.6.1...
undef($code) method did not work for this perl version, rather undef(&$code) does.
Stopped using using Apache::Symbol for this when available.
-Make Apache::ASP script run under perl taint checking -T for perl 5.6.1...
$code =~ tr///; does not work to untaint here, so much use the slower:
$code =~ /^(.*)$/s; $code = $1; method to untaint.
-Check for inline includes changing, included in a dynamic included
loaded at runtime via $Response->Include(). Added test case for
this at t/include_change.t. If an inline include of a dynamic include
changes, the dynamic include should get recompiled now.
-Make OK to use again with PerlTaintCheck On, with MLDBM::Sync 2.25.
Fixed in ASP.pm, t/global.asa, and created new t/taint_check.t test script
+Load more modules when Apache::ASP is loaded so parent will share more
with children httpd:
Apache::Symbol
Devel::Symdump
Config
lib
MLDBM::Sync::SDBM_File
+When FileUploadMax bytes is exceeded for a file upload, there will not
42 hits per sec on Apache::ASP HelloWorld bench
46 hits per sec on Embperl (1.2b10) and
51 hits per sec for CGI Apache::Registry scripts
Before Apache::ASP was clocking some 31 hits per sec.
Apache::ASP also went from 75 to 102 hits per second
on Solaris.
+PerlTaintCheck On friendly. This is mod_perl's way
of providing -T taint checking. When Apache::ASP
is used with state objects like $Session or $Application,
MLDBM must also be made taint friendly with:
$MLDBM::RemoveTaint = 1;
which could be put in the global.asa. Documented.
+Added $Response->ErrorDocument($error_code, $uri_or_string)
API extension which allows for setting of Apache's error
document at runtime. This is really just a wrapper
for Apache->custom_response() renamed so it syncs with
the Apache ErrorDocument config setting. Updated
t/session.inc
t/session.t
t/session_events.t
t/session_events/global.asa
t/session_query_parse.t
t/session_serialize.t
t/share.t
t/stat_inc.t
t/strict_error.inc
t/strict_error.t
t/taint_check.t
t/transfer.inc
t/transfer2.inc
t/unique_packages.inc
t/unique_packages.t
t/xmlsubs.t
t/xmlsubs_aspargs.t
t/xmlsubs_perlargs.t
t/xmlsubsmatch.t
META.yml Module YAML meta-data (added by MakeMaker)
META.json Module JSON meta-data (added by MakeMaker)
$VERSION = 2.29; $DATE="11/19/2001";
+Added some extra help text to the ./cgi/asp --help message
to clarify how to pass arguments to a script from the command line.
+When using $Server->Mail() API, if Content-Type header is set,
and MIME-Version is not, then a "MIME-Version: 1.0" header will be sent
for the email. This is correct according to RFC 1521 which specifies
for the first time the Content-Type: header for email documents.
Thanks to Philip Mak for pointing out this correct behavior.
+Made dependent on MLDBM::Sync version .25 to pass the taint_check.t test
+Improved server_mail.t test to work with mail servers were relaying is denied
+Added <html><body> tags to MailErrorsTo email
--Fixed SessionCount / Session_OnEnd bug, where these things were not
working for $Sessions that never had anything written to them.
This bug was introduced in 2.23/2.25 release.
There was an optimization in 2.23/2.25 where a $Session that was never
Added a test at ./t/session_events.t for these things.
+Some optimizations for $Session API use.
+Added support for XSLT via XML::LibXSLT, patch courtesy of Michael Buschauer
-Got rid of an warning when recompiling changing includes under perl 5.6.1...
undef($code) method did not work for this perl version, rather undef(&$code) does.
Stopped using using Apache::Symbol for this when available.
-Make Apache::ASP script run under perl taint checking -T for perl 5.6.1...
$code =~ tr///; does not work to untaint here, so much use the slower:
$code =~ /^(.*)$/s; $code = $1; method to untaint.
-Check for inline includes changing, included in a dynamic included
loaded at runtime via $Response->Include(). Added test case for
this at t/include_change.t. If an inline include of a dynamic include
changes, the dynamic include should get recompiled now.
-Make OK to use again with PerlTaintCheck On, with MLDBM::Sync 2.25.
Fixed in ASP.pm, t/global.asa, and created new t/taint_check.t test script
+Load more modules when Apache::ASP is loaded so parent will share more
with children httpd:
Apache::Symbol
Devel::Symdump
Config
lib
MLDBM::Sync::SDBM_File
+When FileUploadMax bytes is exceeded for a file upload, there will not
42 hits per sec on Apache::ASP HelloWorld bench
46 hits per sec on Embperl (1.2b10) and
51 hits per sec for CGI Apache::Registry scripts
Before Apache::ASP was clocking some 31 hits per sec.
Apache::ASP also went from 75 to 102 hits per second
on Solaris.
+PerlTaintCheck On friendly. This is mod_perl's way
of providing -T taint checking. When Apache::ASP
is used with state objects like $Session or $Application,
MLDBM must also be made taint friendly with:
$MLDBM::RemoveTaint = 1;
which could be put in the global.asa. Documented.
+Added $Response->ErrorDocument($error_code, $uri_or_string)
API extension which allows for setting of Apache's error
document at runtime. This is really just a wrapper
for Apache->custom_response() renamed so it syncs with
the Apache ErrorDocument config setting. Updated
lib/Apache/ASP/State.pm view on Meta::CPAN
unless(-d $state_dir) {
push(@create_dirs, $state_dir);
}
# create group directory
unless(-d $group_dir) {
push(@create_dirs, $group_dir);
}
if(@create_dirs) {
$self->UmaskClear;
for my $create_dir (@create_dirs) {
# $create_dir =~ tr///; # this doesn't work to untaint with perl 5.6.1, use old method
$create_dir =~ /^(.*)$/s;
$create_dir = $1;
if(mkdir($create_dir, $self->{dir_perms})) {
$asp->{dbg} && $asp->Debug("creating state dir $create_dir");
} else {
my $error = $!;
-d $create_dir || $self->{asp}->Error("can't create group dir $create_dir: $error");
}
}
$self->UmaskRestore;
lib/Apache/ASP/State.pm view on Meta::CPAN
# INIT MLDBM::Sync DBM
{
local $MLDBM::UseDB = $state_db || 'SDBM_File';
local $MLDBM::Serializer = $state_serializer || 'Data::Dumper';
# clear current tied relationship first, if any
$self->{dbm} = undef;
local $SIG{__WARN__} = sub {};
my $error;
$self->{file} =~ /^(.*)$/; # untaint
$self->{file} = $1;
local $MLDBM::RemoveTaint = 1;
$self->{dbm} = &MLDBM::Sync::TIEHASH('MLDBM', $self->{file}, O_RDWR|O_CREAT, $self->{file_perms});
$asp->{dbg} && $asp->Debug("creating dbm for file $self->{file}, db $MLDBM::UseDB, serializer: $MLDBM::Serializer");
$error = $! || 'Undefined Error';
if(! $self->{dbm}) {
$self->{asp}->Error(qq{
Cannot tie to file $self->{file}, $error !!
lib/Apache/ASP/StateManager.pm view on Meta::CPAN
my $r = $self->{r};
my $global_asa = $self->{GlobalASA};
## STATE INITS
# what percent of the session_timeout's time do we garbage collect
# state files and run programs like Session_OnEnd and Application_OnEnd
$self->{state_manager} = &config($self, 'StateManager', undef, $Apache::ASP::StateManager);
# state is the path where state files are stored, like $Session, $Application, etc.
$self->{state_dir} = &config($self, 'StateDir', undef, $self->{global}.'/.state');
$self->{state_dir} =~ tr///; # untaint
$self->{session_state} = &config($self, 'AllowSessionState', undef, 1);
$self->{state_serialize} = &config($self, 'ApplicationSerialize');
if($self->{state_db} = &config($self, 'StateDB')) {
# StateDB - Check StateDB module support
$Apache::ASP::State::DB{$self->{state_db}} ||
$self->Error("$self->{state_db} is not supported for StateDB, try: " .
join(", ", keys %Apache::ASP::State::DB));
$self->{state_db} =~ /^(.*)$/; # untaint
$self->{state_db} = $1; # untaint
# load the state database module && serializer
$self->LoadModule('StateDB', $self->{state_db});
}
if($self->{state_serializer} = &config($self, 'StateSerializer')) {
$self->{state_serializer} =~ tr///; # untaint
$self->LoadModule('StateSerializer', $self->{state_serializer});
}
# INTERNAL tie to the application internal info
my %Internal;
tie(%Internal, 'Apache::ASP::State', $self, 'internal', 'server')
|| $self->Error("can't tie to internal state");
my $internal = $self->{Internal} = bless \%Internal, 'Apache::ASP::State';
$self->{state_serialize} && $internal->LOCK;
site/changes.html view on Meta::CPAN
<font face="courier new" size=3><pre>
+Added some extra help text to the ./cgi/asp --help message
to clarify how to pass arguments to a script from the command line.
+When using $Server->Mail() API, if Content-Type header is set,
and MIME-Version is not, then a "MIME-Version: 1.0" header will be sent
for the email. This is correct according to RFC 1521 which specifies
for the first time the Content-Type: header for email documents.
Thanks to Philip Mak for pointing out this correct behavior.
+Made dependent on MLDBM::Sync version .25 to pass the taint_check.t test
+Improved server_mail.t test to work with mail servers were relaying is denied
+Added <html><body> tags to MailErrorsTo email
--Fixed SessionCount / Session_OnEnd bug, where these things were not
working for $Sessions that never had anything written to them.
This bug was introduced in 2.23/2.25 release.
There was an optimization in 2.23/2.25 where a $Session that was never
site/changes.html view on Meta::CPAN
Added a test at ./t/session_events.t for these things.
+Some optimizations for $Session API use.
+Added support for XSLT via XML::LibXSLT, patch courtesy of Michael Buschauer
-Got rid of an warning when recompiling changing includes under perl 5.6.1...
undef($code) method did not work for this perl version, rather undef(&$code) does.
Stopped using using Apache::Symbol for this when available.
-Make Apache::ASP script run under perl taint checking -T for perl 5.6.1...
$code =~ tr///; does not work to untaint here, so much use the slower:
$code =~ /^(.*)$/s; $code = $1; method to untaint.
-Check for inline includes changing, included in a dynamic included
loaded at runtime via $Response->Include(). Added test case for
this at t/include_change.t. If an inline include of a dynamic include
changes, the dynamic include should get recompiled now.
-Make OK to use again with PerlTaintCheck On, with MLDBM::Sync 2.25.
Fixed in ASP.pm, t/global.asa, and created new t/taint_check.t test script
+Load more modules when Apache::ASP is loaded so parent will share more
with children httpd:
Apache::Symbol
Devel::Symdump
Config
lib
MLDBM::Sync::SDBM_File
+When FileUploadMax bytes is exceeded for a file upload, there will not
site/changes.html view on Meta::CPAN
42 hits per sec on Apache::ASP HelloWorld bench
46 hits per sec on Embperl (1.2b10) and
51 hits per sec for CGI Apache::Registry scripts
Before Apache::ASP was clocking some 31 hits per sec.
Apache::ASP also went from 75 to 102 hits per second
on Solaris.
+PerlTaintCheck On friendly. This is mod_perl's way
of providing -T taint checking. When Apache::ASP
is used with state objects like $Session or $Application,
MLDBM must also be made taint friendly with:
$MLDBM::RemoveTaint = 1;
which could be put in the global.asa. Documented.
+Added $Response->ErrorDocument($error_code, $uri_or_string)
API extension which allows for setting of Apache's error
document at runtime. This is really just a wrapper
for Apache->custom_response() renamed so it syncs with
the Apache ErrorDocument config setting. Updated
t/global.asa view on Meta::CPAN
die unless (-e '../t');
for my $dir ( qw(.cache .state) ) {
my @dirs = ($dir);
my @delete_dirs;
while(@dirs) {
my $dir = shift @dirs;
next unless -d $dir;
opendir(DIR, $dir);
for(readdir(DIR)) {
next if /^\.\.?$/;
$_ =~ tr///; # untaint
my $file = "$dir/$_";
if(-d $file) {
push(@dirs, $file);
} elsif(-e $file) {
unlink($file);
} else {
die("$file does not exist, but we just read it");
}
}
unshift(@delete_dirs, $dir);
( run in 0.530 second using v1.01-cache-2.11-cpan-d6f9594c0a5 )