Commit Graph

8 Commits

Author SHA1 Message Date
Ilia Ross
17a393a589 Fix MySQL import fallback for loopback and tunneled servers 2026-10-23 01:30:47 +02:00
Ilia Ross
c12fb7d438 Fix MySQL data imports with private temporary directories
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.
2026-10-23 00:47:32 +02:00
Ilia Ross
130987be89 Fix MySQL server-side import of temporary files
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.
2026-10-22 21:05:39 +02:00
Ilia Ross
9bad05a55d Fix XSS across MySQL database pages 2026-10-22 19:31:58 +02:00
Ilia Ross
a13461f9c1 Fix to respect global file ACLs for server-local imports
Some checks failed
Tests / prove (push) Has been cancelled
Package and upload artifacts / build (push) Has been cancelled
ⓘ 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)
2026-07-07 12:39:35 +02:00
Jamie Cameron
8ff20ff753 Allow selection of mysql character set
https://www.virtualmin.com/node/20361
2011-12-07 16:24:10 -08:00
Jamie Cameron
8a1e346867 Run restores and imports as non-root user 2009-06-24 13:47:53 +00:00
Jamie Cameron
fc1c1b243f Initial checkin of Webmin 2007-04-12 20:24:50 +00:00