This patch fixes CSV imports on systems such as AlmaLinux where MariaDB's `PrivateTmp` setting hides Webmin's temporary files.
The earlier permissions fix could not solve this because the database service still could not see the file.
Imports now use a unique directory under `secure_file_priv`, or the database's data directory, while retaining restricted file permissions and automatic cleanup.
The directory uses the `#sql-` prefix so MariaDB does not treat it as a database during listings, backups, or checks.
Verified live on Debian 13, AlmaLinux 10, Ubuntu 26.04 MariaDB and MySQL 8.4, including database listings and full dumps taken while an import is in progress.
This patch fixes MySQL imports that fail because the database server cannot read the temporary file.
Since the temporary copy is created with mode 0600, a server-side `mysqlimport` fails for imports from a local file, and for uploads by users with a Unix user restriction.
Before running the import as root against a local server, the file is now given the group of the running server process with mode 0640, so the server can read it while other users still cannot. The process is found through the server's reported PID file and must be `mysqld` or `mariadbd`; otherwise the permissions are left unchanged.
This PR fixes privilege boundary bypasses in MySQL database backups.
It restricts custom dump parameters and shared backup settings to users with unrestricted root backup access.
It also prevents database names, table names, and compatibility values from being interpreted as dump options.
The changes include focused tests and passed live regression testing with MySQL and MariaDB.
This patch addresses non-root MySQL backup hooks remaining unreachable after original patch https://github.com/webmin/webmin/commit/6873c65.
Now it makes before and after commands available when backups run as a configured non-root Unix user.
Root hook execution remains limited to cron-eligible Webmin users, and Usermin remains excluded from backup hooks.
This patch fixes a horrible regression introduced by the original sandbox patch 166cfefa28.
MariaDB sandbox mode blocks the `source` command used by Webmin and Virtualmin restores, breaking all restores.
SQL files are now passed directly to the client while preserving binary-log suppression and compatibility with older clients.
ⓘ Skip invalid `#mysql50#.` entries in SQL and mysqlshow database listings so stray directories don't break the MariaDB page. Preserve valid dot-prefixed, hash-prefixed, and legacy database names.
Reproduce by creating an ordinary `.config` directory in MariaDB's data directory and opening the Webmin MariaDB module. On AlmaLinux, starting `user@27.service` also reproduces the issue because the globally enabled Podman user restart service creates `.config` and `.local` in the mysql account's home. Podman is one possible source, and the failure doesn't depend on it.
Fixes https://forum.virtualmin.com/t/error-accessing-mariadb-server-through-webmin/138118
This fixes missing permission checks in the MySQL manual configuration editor, with both read and write endpoints now require full configuration permissions to match the existing checks used by the configuration editor.
#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.
Every module now has a reviewed desc_tr and longdesc_tr in
module.info.tr - 245 strings across 125 modules. Previously 37 were
reviewed, 194 came from module.info.tr.auto and 14 were missing
entirely (grub2, hardware-info, kea-dhcp, logviewer, nftables, systemd,
xterm), so those modules showed English titles in the Webmin menu.
The reviewed strings are removed from module.info.tr.auto, which now
holds only name_tr - the same split the de and ca translations use.
Thirty-six of those files became empty and are deleted.
Some of the machine text this replaces was wrong rather than just
clumsy:
sarg "Squid Report Generator" had become "Kalamar Rapor
Oluşturucu" - the fish, not the proxy
heartbeat the product name was translated as "Kalp Atışı"
cluster-cron "Cron Jobs" had become "Cron İş İlanları" (job ads)
proc "renice" was translated as "rename"
samba "file and print shares" was split into "create a samba
file" and "print the shares"
exports, hpuxexports, sgiexports, inetd, init, mount, net
each repeated the file path mid-sentence
firewall, the "(iptables)" and "(ip6tables)" qualifiers that
firewall6 distinguish the two modules were dropped
Turkish capitalisation of English words was also wrong throughout
("İptables", "İnetd", "İscsitarget", "İnternet"), and three previously
reviewed strings were stored as double-encoded UTF-8 (cron/desc_tr,
mailboxes/desc_tr, mailboxes/longdesc_tr).
cluster-cron and ldap-server carried a stray desc_de_tr key - a German
key that had leaked into the Turkish file. It is removed.
A consistency check of every lang/tr against its lang/en turned up 58
lines that were wrong independently of the missing translations. All of
them are fixed here:
Missing or wrong $N placeholders (the value silently disappears from
the message at runtime, or the wrong value is shown):
acl/cert_eca, acl/hide_desc, adsl-client/index_stopdesc,
apache/reconfig_ever, apache/log_files, apache/log_files_l,
bind8/log_manual, dhcpd/listl_lfnotcont, fdisk/mkfs_desc1,
fdisk/fsck_desc1, fdisk/tunefs_desc, hpuxexports/save_ehost,
inittab/log_rename, mysql/index_ever, mysql/index_version,
mysql/log_perm_create, mysql/log_perm_delete, mysql/log_perm_modify,
sendmail/index_epath, sendmail/index_startmsg, sendmail/asave_ematch,
sendmail/mailers_efile, sendmail/generics_efile,
webalizer/index_ewebalizer, webalizer/index_econf
cron/env_ename carried a $1 that lang/en does not have, and its text
described a different error than the key means.
adsl-client/index_stopdesc and inittab/log_rename each repeated $1
where $2 was meant, so both values printed the same string.
HTML markup that did not match lang/en:
bind8/mass_desc, dhcpd/index_dhcpdnotfound, firewall/index_existing,
inetd/index_applymsg, mysql/index_nomod, mysql/index_nomods,
samba/esync_msg, samba/viewu_list, sendmail/trusts_desc,
sendmail/mailers_desc2, sendmail/domains_desc, squid/clear_msgclear,
status/proc_thresh
Several of these were also truncated mid-sentence, dropping a whole
sentence of the original text; those are now translated in full.
Encoding:
mailboxes/confirm_warnf was stored as double-encoded UTF-8 and
displayed as mojibake. It also used $1 twice instead of $1 and $2.
Trailing whitespace:
proc/kill_term, kill_hup, kill_stop, kill_cont
Untranslated strings:
fdisk/select_* device descriptions, mount/irix_mode0, irix_mode0cd,
shorewall/tunnels_ipsec:noah
bind8/mass_desc previously translated the literal configuration
keywords master, slave, stub and forward into Turkish; they are now
left in English, since they are values the user has to type.
Adds the 504 strings that mysql/lang/tr was missing, so the module is now
fully translated, and removes mysql/lang/tr.auto.
114 of the new strings are shared verbatim with the postgresql module and
reuse its translation; as elsewhere, reuse required the two lang/en values
to be byte-identical, which excluded 57 keys whose English differs.
MySQL identifiers stay in English: my.cnf, the [mysqld] section, MYSQL_PWD,
.my.cnf, InnoDB, MyISAM, mysql-bin, SQL mode, X509 and the compatibility
target names (ANSI, Oracle, DB2, MaxDB and so on).
Corrects verifiable defects in the shipped Turkish translations across
25 modules. No .auto (machine-translated) files are touched.
Placeholder bugs (33 keys) - substitution variables were missing,
duplicated or renumbered relative to lang/en:
* fdisk/mkfs_desc1 used $1 twice, so the "all data will be permanently
erased" confirmation named the filesystem type instead of the target
device.
* apache/reconfig_ever linked to <a href='$1'> instead of $2, pointing
the "module configuration" link at the version string.
* useradmin/export_eopen contained the Perl special variable $! rather
than $1.
* adsl-client/index_stopdesc, inittab/log_rename, hpuxexports/save_ehost,
mysql/log_perm_* and others repeated $1 where $2/$3 was intended.
* cron/env_ename referenced $1, which lang/en does not provide.
HTML markup bugs (19 keys) - tags were dropped or swapped, breaking
rendering or links:
* useradmin/batch_desc6 and batch_desc3 contained the literal strings
"$batch_desc1" and "$batch_desc0" and rendered as plain text.
* bind8/mass_desc translated the literal named.conf keywords master,
slave, stub and forward, which would lead users to enter invalid
configuration values. These are now left untranslated.
* mysql/index_nomod, samba/esync_msg, squid/clear_msgclear and others
lost <tt>/<b> pairs present in lang/en.
Encoding (10 keys) - mailboxes/lang/tr contained double-encoded UTF-8
(mojibake), e.g. "klasöründen" instead of "klasöründen".
Untranslated strings (96 keys) - htaccess-htpasswd/lang/tr was a verbatim
copy of lang/en and is now fully translated. Remaining English strings in
fdisk, mount, shorewall, webalizer, xinetd and firewall are translated.
Technical identifiers (LVM VG/LV, IPsec AH) are deliberately kept in
English.
All modified files are valid UTF-8, keep their original key order and
line count, and their placeholders now match lang/en exactly.
This PR adds a "Binary Logging" page to configure log format, file size and retention, rotate or purge logs, and support restore sessions that do not write back to binary logs.
ⓘ Centralize global file ACL checks for server-local reads and applies them to batch, LDAP batch, MySQL, and PostgreSQL local import and restore flows. Files are read under the configured `fileunix` identity and staged with the correct command-user ownership, preventing constrained Webmin users from bypassing `root`, `otherdirs`, or `fileunix`.
9ceffce70f (r191495975)
* The MySQL module in Alpine it lacks default values. This change
uses the necessary values for the module to function.
* These values work for any version of Alpine Linux from 3.8
to Edge, since MariaDB is and always has been the default package.
* The tools server package was included in the package instalation
* Missing changelog entries were included
* Note: Recognize mariadbd option groups and binaries in MySQL config, SSL, syslog, and safe-mode command discovery while preserving existing mysqld/mariadb compatibility.