MDEV-40786 make mariadb-plugin great - #5597
Draft
MooSayed1 wants to merge 2 commits into
Draft
Conversation
gkodinov
requested changes
Aug 26, 2026
gkodinov
left a comment
Member
There was a problem hiding this comment.
Thanks for looking into this. This is nowhere near close to being ready for review. Converting to draft until it's actually delivering towards the specification in the jira.
gkodinov
marked this pull request as draft
August 26, 2026 08:20
MooSayed1
force-pushed
the
MDEV-40786
branch
6 times, most recently
from
August 31, 2026 20:56
a54ebba to
caa1579
Compare
Add search, install, and uninstall subcommands to mariadb-plugin with input validation and case normalization, while keeping legacy ENABLE and DISABLE syntax functional for backward compatibility. Bake the installation layout into the binary at compile time (RPM, DEB, or tarball), as it cannot be derived from the path alone since RPM and DEB use the same directory, and verify the executable path at runtime via argv[0] and mysys path helpers to ensure package managers and tarball directories target the correct installation. Delegate install and uninstall to the system package manager on RPM and DEB installations, so that plugin files stay owned by it. The plugin name maps to the uniform package name mariadb-plugin-<name>. Commands run through fork and execvp with an argument vector, never a shell, and inherit the standard streams, so the package manager prompts the user itself and its exit code is passed through. RPM packages are named differently, so they get the uniform name as a Provides, derived from the plugin component in cmake/plugin.cmake. DEB packages already carry it. On RPM, uninstall resolves the real package name with rpm --whatprovides, because dnf 5 does not accept Provides names for removal. Search lists the plugins the installation can install: the plugin name, installed or available, and the description, filtered by an optional search term. The distribution's package index is queried for everything providing mariadb-plugin-* (repoquery for dnf, apt-cache, zypper search plus info --provides) and each output is parsed into the same uniform format, so the user always sees plugin names, not the distribution's package names. Add a --dry-run option that prints the commands install and uninstall would run instead of running them, with the package name resolved, and without requiring root. It is long only, as -n is taken by the legacy --no-defaults option. Test the command line handling in main.mariadb-plugin: unknown commands, argument counts, plugin name validation and that the deprecated ENABLE|DISABLE syntax still reaches the old code path. Installing and removing packages is not testable there, as the tool acts only when it runs from the location it was installed to.
MooSayed1
force-pushed
the
MDEV-40786
branch
2 times, most recently
from
September 5, 2026 13:38
af18227 to
802ef38
Compare
Uninstall removes a plugin from a tarball installation using its manifest, <basedir>/.mariadb-plugin/<name>.list: delete exactly the files and directories listed there, then the manifest itself. Every path is validated first, and a corrupt manifest deletes nothing. Install reads the plugin tarball itself and judges every entry before writing anything: links, devices, absolute paths and ".." are refused, setuid bits dropped, existing files never overwritten, and the CPack top directory stripped when it is named like the archive. Files are then written and recorded in the manifest as they land, so a failure at any point is undone through that same manifest. --file=PATH names the tarball until downloading exists, --sha256=HEX verifies it, and the result is a hint how to enable the plugin, never a config edit.
MooSayed1
force-pushed
the
MDEV-40786
branch
from
September 6, 2026 17:43
802ef38 to
f649218
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Jira issue number for this PR is: MDEV-40786
Description
Turns
mariadb-plugininto a plugin package manager. Same interface onRPM, DEB and tarball installations:
<plugin> ENABLE|DISABLEstill works, unchanged, marked deprecated.INSTALL_LAYOUT; at runtime the toolchecks it runs from the installation it belongs to.
dnf/zypper/apt-getviafork()/execvp(), noshell, exit code passed through. Uniform name
mariadb-plugin-<name>; RPMpackages get it as a
Provides(cmake/plugin.cmake).uninstallon RPMresolves the real name with
rpm -q --whatprovides(dnf 5 needs it).searchqueries the package index and prints name, installed/available,description.
install <name> --file=<tarball>reads the archive itself (zlib,no
tar), refuses links,.., absolute paths, overwrites. Extraction isnext.
uninstallremoves what<basedir>/.mariadb-plugin/<name>.listrecords. Download and tarball
searchwait for the download site.--dry-runprints what would be done, no root needed.Release Notes
mariadb-plugingainssearch,installanduninstall, working the sameon RPM, DEB and tarball installations.
--dry-runshows what would be done.The legacy
ENABLE|DISABLEsyntax is deprecated but still works.How can this PR be tested?
main.mariadb-plugincovers the command line. Delegation needs the binary inits installed location, so it belongs to the install/upgrade builders.
Manually:
Tested in containers: Debian trixie (real repos), Fedora 42 (dnf 5) and
openSUSE Tumbleweed (local repo built from this branch). Tarball: against
the foundry output built from bb-11.4-MDEV-40608, plus hostile archives.
Basing the PR against the correct MariaDB version
New feature, targets
main.PR quality check