Fix validation errors
authorJamie Cameron <jcameron@webmin.com>
Mon, 25 Jul 2011 00:09:48 +0000 (17:09 -0700)
committerJamie Cameron <jcameron@webmin.com>
Mon, 25 Jul 2011 00:09:48 +0000 (17:09 -0700)
https://www.virtualmin.com/node/18939

miniserv.pl
servers/link.cgi
webmin/defaultacl [new file with mode: 0644]
webmin/webmin-lib.pl
webminlog/search.cgi

index cff21ac..75b694b 100755 (executable)
@@ -2231,7 +2231,7 @@ if (&get_type($full) eq "internal/cgi" && $validated != 4) {
                }
        $ENV{"QUERY_STRING"} = $querystring;
        $ENV{"MINISERV_CONFIG"} = $config_file;
-       $ENV{"HTTPS"} = "ON" if ($use_ssl || $config{'inetd_ssl'});
+       $ENV{"HTTPS"} = $use_ssl || $config{'inetd_ssl'} ? "ON" : "";
        $ENV{"MINISERV_PID"} = $miniserv_main_pid;
        $ENV{"SESSION_ID"} = $session_id if ($session_id);
        $ENV{"LOCAL_USER"} = $localauth_user if ($localauth_user);
index 391aabd..f6f5dd3 100755 (executable)
@@ -129,9 +129,10 @@ while(1) {
        }
 
 my $defport = $s->{'ssl'} ? 443 : 80;
-if ($header{'location'} =~ /^(http|https):\/\/$s->{'host'}:$s->{'port'}(.*)$/ ||
-    $header{'location'} =~ /^(http|https):\/\/$s->{'host'}(.*)/ &&
-    $s->{'port'} == $defport) {
+if ($header{'location'} &&
+    ($header{'location'} =~ /^(http|https):\/\/$s->{'host'}:$s->{'port'}(.*)$/||
+     $header{'location'} =~ /^(http|https):\/\/$s->{'host'}(.*)/ &&
+     $s->{'port'} == $defport)) {
        # fix a redirect
        &redirect("$url$2");
        exit;
diff --git a/webmin/defaultacl b/webmin/defaultacl
new file mode 100644 (file)
index 0000000..acb7a08
--- /dev/null
@@ -0,0 +1,2 @@
+allow=
+disallow=
index 47f8fae..4f79c7b 100755 (executable)
@@ -1751,7 +1751,7 @@ if (!$bf) {
        }
 my @rv;
 my $fh;
-&open_readfile($fh, $bf);
+&open_readfile($fh, $bf) || return ();
 while(<$fh>) {
        s/\r|\n//g;
        my ($type, $who, $fails, $when) = split(/\s+/, $_);
index 83b5b02..f959f24 100755 (executable)
@@ -48,6 +48,10 @@ elsif ($in{'tall'} == 0) {
        $to = &parse_time('to');
        $to = $to ? $to + 24*60*60 - 1 : time();
        }
+else {
+       # All time
+       $from = $to = 0;
+       }
 
 if ($in{'csv'}) {
        print "Content-type: text/csv\n\n";
@@ -63,6 +67,7 @@ my %index;
 open(LOG, $webmin_logfile);
 while(my ($id, $idx) = each %index) {
        my ($pos, $time, $user, $module, $sid) = split(/\s+/, $idx);
+       $time ||= 0;
        if (($in{'uall'} == 1 ||
             $in{'uall'} == 0 && $in{'user'} eq $user ||
             $in{'uall'} == 3 && $in{'ouser'} eq $user ||
@@ -187,9 +192,9 @@ elsif (@match) {
                my $desc = &get_action_description($act, 0);
                my $anno = &get_annotation($act);
                push(@cols, "<a href='view.cgi?id=$act->{'id'}".
-                     "&return=".&urlize($in{'return'}).
-                     "&returndesc=".&urlize($in{'returndesc'}).
-                     "&search=".&urlize($in).
+                     "&return=".&urlize($in{'return'} || "").
+                     "&returndesc=".&urlize($in{'returndesc'} || "").
+                     "&search=".&urlize($in || "").
                      "'>$desc</a>");
                if ($anno) {
                        $cols[$#cols] .= "&nbsp;<img src=images/star.gif>";