Backport of r1335882 and r1325724 from trunk.
Submitted by: rbowen
Reviewed by: rjung, humbedooh
Backported by: rjung
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@
1364713 13f79535-47bb-0310-9956-
ffa450edef68
possible XSS for a site where untrusted users can upload files to
a location with MultiViews enabled. [Niels Heinen <heinenn google.com>]
+ *) Add "strict" and "warnings" pragmas to Perl scripts. [Rich Bowen]
+
*) Honor DefaultRuntimeDir for mutexes, socache and CGID socket.
[Jim Jagielski]
+1: trawick, jorton, rjung
+1 before r1364601 was added: jim
- * docs+support: Encourage best practice in Perl scripts (use strict, warnings).
- trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1335882 and
- http://svn.apache.org/viewvc?view=revision&revision=1325724
- 2.4.x patch: trunk patch works
- +1: rjung, humbedooh, rbowen
-
* apxs: Make apxs use LDFLAGS from config_vars.mk in addition to
CFLAGS and CPPFLAGS.
trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1343094
##
## printenv -- demo CGI program which just prints its environment
##
+use strict;
+use warnings;
print "Content-type: text/plain; charset=iso-8859-1\n\n";
-foreach $var (sort(keys(%ENV))) {
- $val = $ENV{$var};
+foreach my $var (sort(keys(%ENV))) {
+ my $val = $ENV{$var};
$val =~ s|\n|\\n|g;
$val =~ s|"|\\"|g;
print "${var}=\"${val}\"\n";
# The combined log file is read from stdin. Records read
# will be appended to any existing log files.
#
-%is_open = ();
+use strict;
+use warnings;
-while ($log_line = <STDIN>) {
+my %is_open = ();
+
+while (my $log_line = <STDIN>) {
#
# Get the first token from the log record; it's the
# identity of the virtual host to which the record
# applies.
#
- ($vhost) = split (/\s/, $log_line);
+ my ($vhost) = split (/\s/, $log_line);
#
# Normalize the virtual host name to all lowercase.
# If it's blank, the request was handled by the default
# server, so supply a default name. This shouldn't
# happen, but caution rocks.
#
- $vhost = lc ($vhost) or "access";
+ $vhost = lc ($vhost) || "access";
#
# if the vhost contains a "/" or "\", it is illegal so just use
# the default log to avoid any security issues due if it is interprted