This PR stops treating `rpc=0` as a safe-user restriction, restoring File Manager ops and admin features for fully privileged accounts created with RPC disabled.
Preserve explicit `_safe` restrictions and product roles.
Regression tests and Perl syntax checks pass.
Fixes https://github.com/webmin/webmin/issues/2837
This PR adds a "Redirect all requests" option to the server block and location URL Re-Writing pages in the Nginx Webserver module, backed by the Nginx return directive with a choice of 301, 302, 303, 307 or 308.
The existing rewrite table only offers the redirect and permanent flags, which map to 302 and 301. The other codes requested on the forum are not supported by rewrite at all, so they can only be provided through return.
The new option only manages return directives that are redirects. A bare URL form such as return https://example.com/; is shown as a 302, while non-redirect uses like return 404; are hidden from the page and never modified or removed.
Example of the resulting config for a server block:
return 308 "https://example.com$request_uri";
Fixes https://forum.virtualmin.com/t/137940
ⓘ Values with a # were written unquoted, so on the next read the module took the # as the start of a comment and lost the rest of the line.
For example, a redirect saved as return 301 https://example.com/docs#install; then showed as no redirect on the page, and re-saving it added a duplicate rewrite_log directive that Nginx rejected.
So, before the fix, saving a redirect to https://example.com/docs#install wrote:
return 301 https://example.com/docs#install;
rewrite_log off;
On the next read the module dropped everything after the #, so it saw one merged line:
return 301 https://example.com/docs rewrite_log off;
The redirect disappeared from the page, and saving again appended a second rewrite_log off;, which Nginx rejects as a duplicate.
After the fix the same save writes:
return 301 "https://example.com/docs#install";
rewrite_log off;
Nginx treats the quoted and unquoted forms identically, and the module reads it back correctly.
ⓘ Decode octal-escaped spaces when reading /etc/mtab, as is already done for /etc/fstab, so dashboard disk usage no longer runs df on non-existent paths and fills the error log.
Also quote the path passed to df -i, and parse df output from the numeric columns so a device name containing a space, such as a ZFS dataset, no longer shifts the values.
Fixes https://github.com/webmin/webmin/issues/2833
ⓘ Run cp and mv through backquote_logged and capture their stderr, so the actual command error is shown instead of an unrelated $! value.
https://github.com/webmin/webmin/issues/2834
The file was regenerated when master added acl/forgot_sudouser, and the
regeneration dropped the trailing newline. All 481 files in this branch
now end with one.
Both issues were raised in review.
webmin/upgrade_desc had <a href="webmin.com">, which a browser resolves
against the Webmin server rather than the public site. lang/en has
<a href=https://webmin.com>; the Turkish now matches. This was the only
relative href in any Turkish file.
proc uses __norefs=1, so the four $stime values were displayed
literally instead of expanding. lang/en spells the word out in all four
places rather than referencing stime, so the Turkish now does the same.
A scan for the same class of defect across every module found one more
case that had not been reported: useradmin/uedit_dothers was
$udel_dothers, and useradmin also sets __norefs=1. lang/en spells that
one out too, so it is fixed the same way.
The scan also found heartbeat/conf_auto_on and conf_auto_off, which are
${conf_enabled} and ${conf_disabled} in lang/en itself - so English is
affected as well, and conf_auto_ references ${default}, a key that does
not exist in the file. That is an upstream bug rather than a
translation one, so it is left alone here and reported on the PR.
#2829 landed on master and touched 173 of the same keys this branch
rewrites, which is where the conflicts came from.
Resolved by rule rather than by hand: for any key #2829 already fixed
and merged, master's value wins (54 keys); everything else keeps this
branch's version. That keeps the diff against master limited to what is
genuinely new here, and avoids re-editing work that is already upstream.
It also avoids a regression. This branch was cut before #2829, so it
still carried the old double-encoded UTF-8 in nine mailboxes strings
(confirm_warnallf, left_autoreply, left_folders, left_forward,
left_pass, left_sig, mail_fromfilter, mail_selread, mail_subfilter).
Taking master's value for those keeps them fixed. A mojibake scan over
the whole tree after the merge reports 0 remaining lines.
master also added acl/forgot_sudouser, which is translated here, so
lang/tr is still complete at 31,523 of 31,523 keys.