From 270bcfd5c2825b2537591771e84be4dad5f44bef Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Wed, 19 Dec 2007 06:27:12 +0000 Subject: [PATCH] Readonly mode fixes --- proc/proc-lib.pl | 4 ++-- syslog/save_log.cgi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/proc/proc-lib.pl b/proc/proc-lib.pl index 798e19cdf..fc6865a98 100644 --- a/proc/proc-lib.pl +++ b/proc/proc-lib.pl @@ -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; } diff --git a/syslog/save_log.cgi b/syslog/save_log.cgi index 3740b3b88..730069ea5 100755 --- a/syslog/save_log.cgi +++ b/syslog/save_log.cgi @@ -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 "$text{'view_empty'}\n" if (!$got); print "\n";