--- doc/loncapafiles/sanitycheck.piml 2002/03/03 04:29:10 1.1 +++ doc/loncapafiles/sanitycheck.piml 2006/09/28 22:52:43 1.20 @@ -1,7 +1,8 @@ + - - + + + + +/etc/httpd/conf/loncapa.conf +/etc/httpd/loncapa.conf +/etc/apache2/loncapa.conf -my $diff=`diff -y --suppress-common-lines ../access.conf | grep -v PerlSetVar | grep -v 'Include conf/loncapa.conf'`; -if ($diff) { - print "**** ERROR **** There are unexpected differences for \n"; -} open IN, "<"; my $hbug=-1; my $dbug=-1; @@ -61,6 +129,11 @@ while (<IN>) { $dbug=0; $dbug=1 if $v=~/\W/; $dbug=1 if $v=~/\_/; + # Avoid namespace conflicts under the web server's DocumentRoot. + my @badnames=('raw','userfiles','priv','adm','uploaded'); + foreach my $bad (@badnames) { + $dbug=1 if $v eq $bad; + } } } if ($hbug) { @@ -79,6 +152,7 @@ my $dbug=0; my $sbug=0; my $fbug=0; while (<IN>) { + next if (/^(\#|\s*$)/); if (/\S/) { $rbug=1 if /\r/; my @a=split(/\:/,$_); @@ -86,8 +160,13 @@ while (<IN>) { $dbug=1 if $a[0]=~/\_/; $dbug=1 if $a[1]=~/\_/; $dbug=1 if $a[1]=~/\W/; - $fbug=1 if @a!=5; - $sbug=1 if /\s.+$/; + $fbug=1 if (@a<4 || @a>5); + my $expr='\s.+$'; + $sbug=1 if ($a[0] =~ /$expr/ || + $a[1] =~ /$expr/ || + $a[2] =~ /$expr/ || + $a[3] =~ /$expr/ ) +; } } close IN; @@ -98,7 +177,7 @@ if ($dbug) { print "**** ERROR **** has invalid host id or domain id\n"; } if ($fbug) { - print "**** ERROR **** is lacking 5 columns for every row\n"; + print "**** ERROR **** is lacking 4 or 5 columns for every row\n"; } if ($sbug) { print "**** ERROR **** has illegal whitespace character\n"; @@ -110,12 +189,14 @@ open IN, "<"; my $rbug=0; my $dbug=0; my $sbug=0; -while (<IN>) { - if (/\S/) { - $rbug=1 if /\r/; - $dbug=1 if $_=~/\W.*\n$/; - $dbug=1 if $_=~/\_/; - $sbug=1 if /\s.+$/; +while (my $line = <IN>) { + if ($line =~ /\S/) { + $rbug=1 if $line=~/\r/; + if ($line =~ /\W.*\n/) { + $dbug=$line if ($line !~/\w:(?:primary|default)$/); + } + $dbug=$line if $line=~/\_/; + $sbug=1 if $line=~/\s.+$/; } } close IN; @@ -123,7 +204,7 @@ if ($rbug) { print "**** ERROR **** is DOS-formatted\n"; } if ($dbug) { - print "**** ERROR **** has invalid host id\n"; + print "**** ERROR **** has invalid host id ($dbug)\n"; } if ($sbug) { print "**** ERROR **** has illegal whitespace character\n";