[LON-CAPA-cvs] cvs: doc /loncapafiles sanitycheck.piml
albertel
lon-capa-cvs-allow@mail.lon-capa.org
Fri, 13 Apr 2007 18:37:28 -0000
albertel Fri Apr 13 14:37:28 2007 EDT
Modified files:
/doc/loncapafiles sanitycheck.piml
Log:
- sanity check allows .- loids/domains
- sanity check understands host.tab server entires
Index: doc/loncapafiles/sanitycheck.piml
diff -u doc/loncapafiles/sanitycheck.piml:1.22 doc/loncapafiles/sanitycheck.piml:1.23
--- doc/loncapafiles/sanitycheck.piml:1.22 Sun Dec 10 18:23:55 2006
+++ doc/loncapafiles/sanitycheck.piml Fri Apr 13 14:37:27 2007
@@ -2,7 +2,7 @@
"http://lpml.sourceforge.net/DTD/piml.dtd">
<!-- sanitycheck.piml -->
-<!-- $Id: sanitycheck.piml,v 1.22 2006/12/10 23:23:55 albertel Exp $ -->
+<!-- $Id: sanitycheck.piml,v 1.23 2007/04/13 18:37:27 albertel Exp $ -->
<!--
@@ -120,14 +120,14 @@
if (/PerlSetVar\s+lonHostID\s+(\S+)/) {
my $v=$1;
$hbug=0;
- $hbug=1 if $v=~/\W/;
- $hbug=1 if $v=~/\_/;
+ $hbug=1 if $v=~/[^\w.\-]/;
+ $hbug=1 if $v=~/_/;
}
if (/PerlSetVar\s+lonDefDomain\s+(\S+)/) {
my $v=$1;
$dbug=0;
- $dbug=1 if $v=~/\W/;
- $dbug=1 if $v=~/\_/;
+ $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) {
@@ -152,12 +152,17 @@
my $fbug=0;
my %line;
my $line=0;
-while (<IN>) {
+while (my $l = <IN>) {
$line++;
- next if (/^(\#|\s*$)/);
- if (/\S/) {
- if (/\r/) { $rbug=1; push(@{$line{'r'}},$line); }
- my @a=split(/\:/,$_);
+ next if ($l=~/^(\#|\s*$)/);
+ if ($l=~/^\^/) {
+ if ($l !~ /^\^[\w.\-]/) {
+ $dns_bug = 1;
+ push(@{$line{'dns'}},$line);
+ }
+ } elsif ($l=~/\S/) {
+ if ($l=~/\r/) { $rbug=1; push(@{$line{'r'}},$line); }
+ my @a=split(/:/,$l);
if ($a[0]=~/[^\w\-.]/ ||
$a[1]=~/[^\w\-.]/ ||
$a[0]=~/\_/ ||
@@ -184,6 +189,9 @@
if ($sbug) {
print "**** ERROR **** <TARGET /> has illegal whitespace character (lines ".join(', ',@{$line{'s'}}).")\n";
}
+if ($dns_bug) {
+ print "**** ERROR **** <TARGET /> host.tab server entry has characters (lines ".join(', ',@{$line{'dns'}}).")\n";
+}
</file>
<file>
<target dist='default'>/home/httpd/lonTabs/spare.tab</target>