mariadb-pam-git
mariadb-git
· scanned 2026-08-03 00:08:14.047287
Triggered rules
llm_review
The static rules flagged this MEDIUM, but an AI model (anthropic/claude-4.6-sonnet-20260217) reviewed the full PKGBUILD and judged it LOW (confidence 85%): The setuid chmod 4755 on auth_pam_tool is a known, intentional requirement for MariaDB's PAM authentication plugin (the binary needs elevated privileges to read /etc/shadow); this is standard MariaDB packaging practice, not malicious. All sources are from official MariaDB/upstream GitHub repositories, and the package is building from source with no unverifiable prebuilt binaries or obfuscated payloads.
1 higher static finding superseded - not the current verdict (shown for transparency)
privileged_install
The package grants elevated privileges or installs an update path outside pacman: a /etc/sudoers.d rule (often passwordless), a setuid/setgid binary, or a self-update script/service that can fetch and run future code with no checksum verification. The initial install may be verified, but the ongoing privilege + update surface is a real supply-chain / privilege-escalation risk.
-
PKGBUILD:317
chmod 4755 "${pkgdir}"/usr/lib/mysql/plugin/auth_pam_tool_dir/auth_pam_tool
PKGBUILD
1 offending line(s) highlighted# Contributor: Lex Black <autumn-wind@web.de>
# Contributor: João Figueiredo & chaotic-aur <islandc0der@chaotic.cx>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Christian Hesse <mail@eworm.de>
# Follows the development branch for the current GA (General Availability) release
pkgbase=mariadb-git
pkgname=(
'mariadb-libs-git'
'mariadb-clients-git'
'mariadb-git'
'mariadb-mytop-git'
'mariadb-pam-git')
pkgdesc='Fast SQL database server, derived from MySQL'
_pkgver=12.3
pkgver=12.3.2.r283.g8da3462
pkgrel=1
arch=('x86_64')
license=('GPL-2.0-only')
url='https://mariadb.org/'
makedepends=('git' 'boost' 'bzip2' 'cmake' 'cracklib' 'curl' 'jemalloc' 'judy' 'krb5' 'liburing'
'libxcrypt' 'libxml2' 'lz4' 'openssl' 'pcre2' 'systemd' 'zlib' 'zstd' 'xz')
validpgpkeys=('177F4010FE56CA3336300305F1656F24C74CD1D8') # MariaDB Signing Key <signing-key@mariadb.org>
source=("mariadb::git+https://github.com/MariaDB/server.git#branch=${_pkgver}?signed"
'git+https://github.com/MariaDB/mariadb-connector-c.git'
'git+https://github.com/facebook/rocksdb.git'
'git+https://github.com/codership/wsrep-lib.git'
'git+https://github.com/wolfSSL/wolfssl.git'
'git+https://github.com/mariadb-corporation/libmarias3.git'
'git+https://github.com/mariadb-corporation/mariadb-columnstore-engine.git'
'0001-arch-specific.patch')
sha256sums=('SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'966d0854d4aa09dc08b8c1f0cbc65806ca09543ed9a41a3714d400cca49e0adb')
pkgver() {
cd mariadb/
git describe --long --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^mariadb.//'
}
prepare() {
cd mariadb/
# setup git submodules
git config --file=.gitmodules submodule.libmariadb.url ../mariadb-connector-c/
git config --file=.gitmodules submodule.storage/rocksdb/rocksdb.url ../rocksdb/
git config --file=.gitmodules submodule.wsrep-lib.url ../wsrep-lib/
git config --file=.gitmodules submodule.extra/wolfssl/wolfssl.url ../wolfssl/
git config --file=.gitmodules submodule.storage/maria/libmarias3.url ../libmarias3/
git config --file=.gitmodules submodule.storage/columnstore/columnstore.url ../mariadb-columnstore-engine/
git submodule init
git -c protocol.file.allow=always submodule update
# Arch Linux specific patches:
# * enable PrivateTmp for a little bit more security
# * force preloading jemalloc for memory management
# * make systemd-tmpfiles create MYSQL_DATADIR
patch -Np1 < ../0001-arch-specific.patch
}
build() {
local _cmake_options=(
# build options
-DCOMPILATION_COMMENT="Arch Linux"
-DCMAKE_BUILD_TYPE=RelWithDebInfo
#-DCMAKE_BUILD_TYPE=Debug
#-DMYSQL_MAINTAINER_MODE=WARN
-Wno-dev
# file paths
# /etc
-DINSTALL_SYSCONFDIR=/etc
-DINSTALL_SYSCONF2DIR=/etc/my.cnf.d
# /run
-DINSTALL_RUNDATADIR=/run/mariadb
-DINSTALL_UNIX_ADDRDIR=/run/mysqld/mysqld.sock
# /usr
-DCMAKE_INSTALL_PREFIX=/usr
# /usr/bin /usr/include
-DINSTALL_SCRIPTDIR=bin
-DINSTALL_INCLUDEDIR=include/mysql
# /usr/lib
-DINSTALL_PLUGINDIR=lib/mysql/plugin
-DINSTALL_SYSTEMD_UNITDIR=lib/systemd/system/
-DINSTALL_SYSTEMD_SYSUSERSDIR=lib/sysusers.d/
-DINSTALL_SYSTEMD_TMPFILESDIR=lib/tmpfiles.d/
# /usr/share
-DINSTALL_SHAREDIR=share
-DINSTALL_SUPPORTFILESDIR=share/mysql
-DINSTALL_MYSQLSHAREDIR=share/mysql
-DINSTALL_DOCREADMEDIR=share/doc/mariadb
-DINSTALL_DOCDIR=share/doc/mariadb
-DINSTALL_MANDIR=share/man
# /var
-DMYSQL_DATADIR=/var/lib/mysql
# default settings
-DDEFAULT_CHARSET=utf8mb4
-DDEFAULT_COLLATION=utf8mb4_unicode_ci
# /\ WARNING: This option is kind of insane... One expects that AUTO does allow the
# /\7\ build system to decide. Actually this is not true: Every value (ON / AUTO / OFF)
# /_()_\ sets different default values for the build. Let's go with the most secure,
# should be possible to enable at run time for all components.
-DENABLED_LOCAL_INFILE=OFF
# features
-DPLUGIN_EXAMPLE=NO
-DPLUGIN_FEDERATED=NO
-DPLUGIN_FEEDBACK=NO
-DWITH_EMBEDDED_SERVER=ON
-DWITH_EXTRA_CHARSETS=complex
-DWITH_JEMALLOC=ON
-DWITH_LIBWRAP=OFF
-DWITH_PCRE2=system
-DWITH_READLINE=ON
-DWITH_SSL=system
-DWITH_SYSTEMD=yes
-DWITH_UNIT_TESTS=OFF
-DWITH_ZLIB=system
)
# this uses malloc_usable_size, which is incompatible with fortification level 3
export CFLAGS="${CFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
export CXXFLAGS="${CXXFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
mkdir build
cd build
cmake ../mariadb/ "${_cmake_options[@]}"
make
}
check() {
cd build/mysql-test
# Takes *really* long, so disabled by default.
#./mtr --parallel=5 --mem --force --max-test-fail=0
}
package_mariadb-libs-git() {
pkgdesc='MariaDB libraries'
depends=('liburing' 'liburing.so'
'libxcrypt' 'libcrypt.so'
'openssl' 'libcrypto.so' 'libssl.so'
'pcre2' 'libpcre2-8.so'
'zlib' 'libz.so'
'zstd' 'libzstd.so')
optdepends=('krb5: for gssapi authentication')
conflicts=(mariadb-libs
'libmysqlclient'
'libmariadbclient'
'mariadb-connector-c')
provides=('libmariadbclient'
'mariadb-connector-c'
'libmariadb.so'
'libmariadbd.so')
cd build
for dir in libmariadb libmysqld libservices include; do
make -C "$dir" DESTDIR="$pkgdir" install
done
# remove static libraries
rm "${pkgdir}"/usr/lib/*.a
# remove man pages
rm -r "${pkgdir}"/usr/share/man
ln -s mariadb_config "$pkgdir"/usr/bin/mariadb-config
ln -s mariadb_config "$pkgdir"/usr/bin/mysql_config
install -D -m0644 "$srcdir"/mariadb/man/mariadb_config.1 "$pkgdir"/usr/share/man/man1/mariadb_config.1
ln -s mariadb_config.1 "$pkgdir"/usr/share/man/man1/mariadb-config.1
ln -s mariadb_config.1 "$pkgdir"/usr/share/man/man1/mysql_config.1
install -D -m0644 support-files/mariadb.pc "$pkgdir"/usr/share/pkgconfig/mariadb.pc
install -D -m0644 "$srcdir"/mariadb/support-files/mysql.m4 "$pkgdir"/usr/share/aclocal/mysql.m4
}
package_mariadb-clients-git() {
pkgdesc='MariaDB client tools'
depends=("mariadb-libs-git=${pkgver}"
'ncurses' 'libncursesw.so')
conflicts=('mariadb-clients' 'mysql-clients')
provides=("mysql-clients=${pkgver}")
make -C build/client DESTDIR="${pkgdir}" install
# install man pages
make -C build/man DESTDIR="${srcdir}"/client-man install
install -d -m0755 "${pkgdir}"/usr/share/man/man1/
for man in $(find "${pkgdir}"/usr/bin/ ! -type d); do
install -D -m0644 -t "${pkgdir}"/usr/share/man/man1/ "${srcdir}"/client-man/usr/share/man/man1/"$(basename "${man}")".1
done
}
package_mariadb-git() {
pkgdesc='Fast SQL database server, derived from MySQL'
backup=('etc/my.cnf'
'etc/my.cnf.d/client.cnf'
'etc/my.cnf.d/enable_encryption.preset'
'etc/my.cnf.d/mysql-clients.cnf'
'etc/my.cnf.d/provider_bzip2.cnf'
'etc/my.cnf.d/provider_lz4.cnf'
'etc/my.cnf.d/provider_lzma.cnf'
'etc/my.cnf.d/s3.cnf'
'etc/my.cnf.d/server.cnf'
'etc/my.cnf.d/spider.cnf')
install=mariadb.install
depends=("mariadb-clients-git=${pkgver}"
'bzip2' 'libbz2.so'
'coreutils'
'jemalloc'
'libxml2' 'libxml2.so'
'lz4' 'liblz4.so'
'systemd-libs' 'libsystemd.so'
'zstd' 'libzstd.so')
optdepends=('cracklib: for cracklib plugin'
'curl: for ha_s3 plugin'
'galera: for MariaDB cluster with Galera WSREP'
'judy: for Open Query GRAPH (OQGraph) computation engine'
'mariadb-pam: for PAM authentication'
'perl-dbd-mariadb: for mariadb-hotcopy, mariadb-convert-table-format and mariadb-setpermission'
'python-mysqlclient: for myrocks_hotbackup'
'xz: lzma provider')
conflicts=('mariadb' 'mysql')
provides=("mariadb-server=${pkgver}"
"mysql=${pkgver}")
options=('emptydirs')
cd build
make DESTDIR="$pkgdir" install
cd "$pkgdir"
# no SysV init, please!
rm -r etc/logrotate.d
rm usr/bin/rcmysql
rm usr/share/mysql/{binary-configure,mysql{,d_multi}.server}
# move to proper licenses directories
install -d usr/share/licenses/mariadb
mv usr/share/doc/mariadb/COPYING* usr/share/licenses/mariadb/
# move it where one might look for it
mv usr/share/{groonga{,-normalizer-mysql},doc/mariadb/}
# move to pam directories
install -d {etc,usr/lib}/security
mv usr/share/user_map.conf etc/security/
mv usr/share/pam_user_map.so usr/lib/security/
# already installed to real systemd unit directory or useless
rm -r usr/share/mysql/systemd/
rm -r usr/lib/systemd/system/mariadb@bootstrap.service.d
# provided by mariadb-libs
rm usr/bin/{mariadb{_,-},mysql_}config
rm -r usr/include/
rm usr/share/man/man1/{mariadb,mysql}_config.1
rm -r usr/share/aclocal
rm usr/lib/lib*
rm -r usr/lib/pkgconfig
rm usr/lib/mysql/plugin/{auth_gssapi_client,caching_sha2_password,client_ed25519,dialog,mysql_clear_password,parsec,sha256_password,zstd}.so
# provided by mariadb-clients
for bin in $(find "${pkgdir}/../${pkgbase}-clients/usr/bin/" ! -type d); do
rm "${pkgdir}"/usr/bin/"$(basename "${bin}")" "${pkgdir}"/usr/share/man/man1/"$(basename "${bin}")".1
done
# provided by mariadb-pam
install -d -m0755 "${srcdir}"/mariadb-pam/usr/lib/{mysql/plugin,security}/ "${srcdir}"/mariadb-pam/etc/security/
mv usr/lib/mysql/plugin/auth_pam* "${srcdir}"/mariadb-pam/usr/lib/mysql/plugin/
mv usr/lib/security/pam_user_map.so "${srcdir}"/mariadb-pam/usr/lib/security/
mv etc/security/user_map.conf "${srcdir}"/mariadb-pam/etc/security/
# provided by mariadb-mytop
rm usr/bin/mytop
rm usr/share/man/man1/mytop.1
# not needed
rm -r usr/{mariadb-test,sql-bench}
rm usr/share/man/man1/mysql-test-run.pl.1
}
package_mariadb-mytop-git() {
pkgdesc='Top clone for MariaDB'
depends=('perl'
'perl-dbd-mariadb'
'perl-term-readkey')
conflicts=('mytop' 'mariadb-mytop')
provides=("mariadb-mytop=${pkgver}")
install -D -m0755 build/scripts/mytop "${pkgdir}"/usr/bin/mytop
install -D -m0755 mariadb/man/mytop.1 "${pkgdir}"/usr/share/man/man1/mytop.1
}
package_mariadb-pam-git() {
pkgdesc='MariaDB PAM support'
depends=("mariadb=${pkgver}"
'pam' 'libpam.so')
conflicts=('mariadb-pam')
provides=("mariadb-pam=${pkgver}")
backup=('etc/security/user_map.conf')
mv mariadb-pam/{etc,usr}/ "${pkgdir}"/
# make auth_pam_tool setuid!
chmod 4755 "${pkgdir}"/usr/lib/mysql/plugin/auth_pam_tool_dir/auth_pam_tool
}
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-08-03 00:08:14 | LOW | 2 |
| 2026-08-02 00:16:08 | LOW | 2 |
| 2026-08-01 00:11:18 | LOW | 2 |
| 2026-07-31 00:14:10 | LOW | 2 |
| 2026-07-30 00:17:23 | LOW | 2 |
| 2026-07-29 00:25:53 | LOW | 2 |
| 2026-07-28 00:07:28 | LOW | 2 |
| 2026-07-27 00:24:32 | LOW | 2 |
| 2026-07-26 00:07:32 | LOW | 2 |
| 2026-07-25 00:13:44 | LOW | 2 |
| 2026-07-24 00:02:28 | LOW | 2 |
| 2026-07-23 00:14:47 | LOW | 2 |
| 2026-07-22 00:29:32 | LOW | 2 |
| 2026-07-21 00:24:15 | LOW | 2 |
| 2026-07-20 00:19:49 | LOW | 2 |
| 2026-07-19 00:17:08 | LOW | 2 |
| 2026-07-18 00:14:48 | LOW | 2 |
| 2026-07-17 00:06:16 | LOW | 2 |
| 2026-07-16 00:05:41 | LOW | 2 |
| 2026-07-15 00:09:25 | LOW | 2 |