mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 16:50:24 +00:00
Readonly mode fixes
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user