Readonly mode fixes
authorJamie Cameron <jcameron@webmin.com>
Wed, 19 Dec 2007 06:27:12 +0000 (06:27 +0000)
committerJamie Cameron <jcameron@webmin.com>
Wed, 19 Dec 2007 06:27:12 +0000 (06:27 +0000)
proc/proc-lib.pl
syslog/save_log.cgi

index 798e19c..fc6865a 100644 (file)
@@ -107,13 +107,13 @@ elsif ($access{'uid'}) {
 }
 
 # safe_process_exec(command, uid, gid, handle, [input], [fixtags], [bsmode],
-#                  [timeout])
+#                  [timeout], [safe])
 # Executes the given command as the given user/group and writes all output
 # to the given file handle. Finishes when there is no more output or the
 # process stops running. Returns the number of bytes read.
 sub safe_process_exec
 {
-if (&is_readonly_mode()) {
+if (&is_readonly_mode() && !$_[8]) {
        # Veto command in readonly mode
        return 0;
        }
index 3740b3b..730069e 100755 (executable)
@@ -92,7 +92,7 @@ elsif ($in{'view'}) {
                $cat = "(".join(" ; ", @cats).")";
                $got = &foreign_call("proc", "safe_process_exec",
                        "$cat | grep -i $filter | $tailcmd",
-                       0, 0, STDOUT, undef, 1);
+                       0, 0, STDOUT, undef, 1, 0, undef, 1);
        } else {
                # Not filtering .. so cat the most recent non-empty file
                if ($cmd) {
@@ -115,7 +115,7 @@ elsif ($in{'view'}) {
                        }
                $got = &foreign_call("proc", "safe_process_exec",
                        $catter." | $tailcmd", 
-                       0, 0, STDOUT, undef, 1);
+                       0, 0, STDOUT, undef, 1, 0, undef, 1);
                }
        print "<i>$text{'view_empty'}</i>\n" if (!$got);
        print "</pre>\n";