Details
Description
Ref MDEV-41255.
mariadb-plugin-mroonga creates mroonga_command on install. The documentation says not to create it:
As a administrative function that sends commands directly into Groonga, it completely bypassed MariaDB privilege control. Do not create this UDF on a multi-user system that relies on privilege separation of accounts.
The postinst pipes install.sql into the server with no condition, and install.sql creates all eight Mroonga functions. The postinst runs on an upgrade too. Each function in install.sql opens with DROP FUNCTION IF EXISTS, so a function the operator drops comes back. The package offers no way to install the engine without mroonga_command.
|
Ubuntu 24.04, MariaDB 11.8.9-MariaDB-ubu2404, mariadb-plugin-mroonga 1:11.8.9+maria~ubu2404 |
$ dpkg-deb -R mariadb-plugin-mroonga_11.8.9+maria~ubu2404_amd64.deb pkg
|
$ cat pkg/DEBIAN/postinst
|
#!/bin/bash
|
|
|
set -e
|
|
|
# Install Mroonga
|
mariadb --defaults-file=/etc/mysql/debian.cnf < /usr/share/mariadb/mroonga/install.sql || true
|
# Always exit with success instead of leaving dpkg in a broken state
|
|
|
===== mysql.func before the plugin package =====
|
0
|
===== apt install mariadb-plugin-mroonga =====
|
Setting up mariadb-plugin-mroonga (1:11.8.9+maria~ubu2404) ...
|
===== mysql.func after the plugin package =====
|
last_insert_grn_id
|
mroonga_command
|
mroonga_escape
|
mroonga_highlight_html
|
mroonga_normalize
|
mroonga_query_expand
|
mroonga_snippet
|
mroonga_snippet_html
|
===== drop mroonga_command, then upgrade-style reinstall =====
|
after DROP: 0
|
after package reinstall: 1
|
The RPM packages create no function. MariaDB-server owns ha_mroonga.so, and that is the only Mroonga file on the system. No scriptlet runs install.sql, and no RPM has the file. The install(FILES ...) in storage/mroonga/CMakeLists.txt does not have a COMPONENT, so CPack leaves it out.
|
RHEL 9, MariaDB-server 11.8.9-1.el9.x86_64 |
===== which package owns ha_mroonga.so =====
|
MariaDB-server-11.8.9-1.el9.x86_64
|
===== every Mroonga file installed =====
|
/usr/lib64/mysql/plugin/ha_mroonga.so
|
===== install.sql anywhere on the system =====
|
(nothing above = not shipped)
|
===== mysql.func and mysql.plugin after install =====
|
0
|
0
|
===== MariaDB-server scriptlets mentioning mroonga or install.sql =====
|
(none)
|
The Enterprise Server branches do not create the function. 10.6-enterprise builds the mariadb-plugin-mroonga DEB and ships install.sql to /usr/share/mysql/mroonga/, but debian/ does not have a postinst for the package, so nothing runs the file. 11.4-enterprise, 11.8-enterprise and 12.3-enterprise do not have mariadb-plugin-mroonga in debian/control, so the package is not built there. Taken from the sources; the ES packages were not installed.
debian/mariadb-plugin-mroonga.postinst and storage/mroonga/data/install.sql.in read the same on 10.11, 11.4, 11.8, 12.3, 13.0 and 13.1; 10.11 points at /usr/share/mysql and the rest at /usr/share/mariadb. Ubuntu's own 10.11.14 package does the same as our 11.8.9 package.
kou Would you have a look please? Thank you
Attachments
Issue Links
- relates to
-
MDEV-41255 Mroonga command function runs without checking the caller's privileges
-
- Closed
-