Our MariaDB-server RPM creates auth_pam_tool_dir with owner root, and only later in the post install hook script change the ownership to the mysql system user.
When running
rpm --setguids MariaDB-server
the directory owner is reset from "mysql" to "root", and with that and the "owner only" permissions of that directory, the auth_pam_tool utility contained by it can no longer be executed by the server, so breaking PAM authentication completely.
Looking at the plugin/auth_pam/CMakeLists.txt file I can see:
Affected versions determined by checking that respective versions support-files/rpm/server-postin.sh contains a chown for auth_pam_tool_dir
Hartmut Holzgraefe
added a comment - Affected versions determined by checking that respective versions support-files/rpm/server-postin.sh contains a chown for auth_pam_tool_dir
the commit that added chown to postin scriptlet, says
commit 9d18b624675
Author: Sergei Golubchik <serg@mariadb.org>
Date: Wed Jan 15 18:08:02 2020 +0100
rpm/deb and auth_pam_tool_dir/auth_pam_tool
don't let mysql_install_db set SUID bit for auth_pam_tool in rpm/deb
packages - instead package files with correct permissions and
only fix the ownership of auth_pam_tool_dir (which can only be done
after mysql user is created, so in post-install).
Is it wrong? Can you still use %attr(700,mysql,-) ?
Sergei Golubchik
added a comment - the commit that added chown to postin scriptlet, says
commit 9d18b624675
Author: Sergei Golubchik <serg@mariadb.org>
Date: Wed Jan 15 18:08:02 2020 +0100
rpm/deb and auth_pam_tool_dir/auth_pam_tool
don't let mysql_install_db set SUID bit for auth_pam_tool in rpm/deb
packages - instead package files with correct permissions and
only fix the ownership of auth_pam_tool_dir (which can only be done
after mysql user is created, so in post-install).
Is it wrong? Can you still use %attr(700,mysql,-) ?
I thought I had that tested, but after double checking on a fresh Rocky8 VM with no "mysql" user in /etc/passwd yet I'm indeed still getting the "auth_pam_tool_dir" owned by "root", not "mysql". Running rpm --setugids MariaDB-server then fixes that. So my patch was active, but failed for not having the user added yet at the time this information is used during RPM install.
Looking at our sources I can see useradd mysql being done in the post install script, yet checking the Fedora guidelines this should happen in the pre install script instead, which would also solve our problem here:
Hartmut Holzgraefe
added a comment - I thought I had that tested, but after double checking on a fresh Rocky8 VM with no "mysql" user in /etc/passwd yet I'm indeed still getting the "auth_pam_tool_dir" owned by "root", not "mysql". Running rpm --setugids MariaDB-server then fixes that. So my patch was active, but failed for not having the user added yet at the time this information is used during RPM install.
Looking at our sources I can see useradd mysql being done in the post install script, yet checking the Fedora guidelines this should happen in the pre install script instead, which would also solve our problem here:
https://fedoraproject.org/wiki/Packaging:UsersAndGroups#Dynamic_allocation
Sergei Golubchik
added a comment - hholzgra , do you want to check the fix before it's pushed?
Take it from https://buildbot.mariadb.net/archive/pack/bb-10.4-all-builders/
People
Sergei Golubchik
Hartmut Holzgraefe
Votes:
0Vote for this issue
Watchers:
3Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":1620.2000000476837,"ttfb":218,"pageVisibility":"visible","entityId":120440,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"d28b5cd0-880c-4fcd-9afd-554299176502","navigationType":0,"readyForUser":1700.9000000953674,"redirectCount":0,"resourceLoadedEnd":2163.7999999523163,"resourceLoadedStart":257,"resourceTiming":[{"duration":802.4000000953674,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1059.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":802.4000000953674,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":257.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":257.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1059.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":811.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":257.5,"connectEnd":257.5,"connectStart":257.5,"domainLookupEnd":257.5,"domainLookupStart":257.5,"fetchStart":257.5,"redirectEnd":0,"redirectStart":0,"requestStart":257.5,"responseEnd":1069.2999999523163,"responseStart":1069.2999999523163,"secureConnectionStart":257.5},{"duration":860.0999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":257.7000000476837,"connectEnd":257.7000000476837,"connectStart":257.7000000476837,"domainLookupEnd":257.7000000476837,"domainLookupStart":257.7000000476837,"fetchStart":257.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":257.7000000476837,"responseEnd":1117.7999999523163,"responseStart":1117.7999999523163,"secureConnectionStart":257.7000000476837},{"duration":864.5999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":257.90000009536743,"connectEnd":257.90000009536743,"connectStart":257.90000009536743,"domainLookupEnd":257.90000009536743,"domainLookupStart":257.90000009536743,"fetchStart":257.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":257.90000009536743,"responseEnd":1122.5,"responseStart":1122.5,"secureConnectionStart":257.90000009536743},{"duration":865.1999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":258.10000014305115,"connectEnd":258.10000014305115,"connectStart":258.10000014305115,"domainLookupEnd":258.10000014305115,"domainLookupStart":258.10000014305115,"fetchStart":258.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":258.10000014305115,"responseEnd":1123.2999999523163,"responseStart":1123.2999999523163,"secureConnectionStart":258.10000014305115},{"duration":865.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":258.2000000476837,"connectEnd":258.2000000476837,"connectStart":258.2000000476837,"domainLookupEnd":258.2000000476837,"domainLookupStart":258.2000000476837,"fetchStart":258.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":258.2000000476837,"responseEnd":1123.9000000953674,"responseStart":1123.9000000953674,"secureConnectionStart":258.2000000476837},{"duration":961.9000000953674,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":258.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":258.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1220.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":865.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":258.60000014305115,"connectEnd":258.60000014305115,"connectStart":258.60000014305115,"domainLookupEnd":258.60000014305115,"domainLookupStart":258.60000014305115,"fetchStart":258.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":258.60000014305115,"responseEnd":1124.4000000953674,"responseStart":1124.4000000953674,"secureConnectionStart":258.60000014305115},{"duration":961.9000000953674,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":258.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":258.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1220.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":866.1000001430511,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":259,"connectEnd":259,"connectStart":259,"domainLookupEnd":259,"domainLookupStart":259,"fetchStart":259,"redirectEnd":0,"redirectStart":0,"requestStart":259,"responseEnd":1125.1000001430511,"responseStart":1125.1000001430511,"secureConnectionStart":259},{"duration":1231.6000001430511,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":259.7999999523163,"connectEnd":259.7999999523163,"connectStart":259.7999999523163,"domainLookupEnd":259.7999999523163,"domainLookupStart":259.7999999523163,"fetchStart":259.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":259.7999999523163,"responseEnd":1491.4000000953674,"responseStart":1491.4000000953674,"secureConnectionStart":259.7999999523163},{"duration":1898.3000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":259.7999999523163,"connectEnd":259.7999999523163,"connectStart":259.7999999523163,"domainLookupEnd":259.7999999523163,"domainLookupStart":259.7999999523163,"fetchStart":259.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":259.7999999523163,"responseEnd":2158.100000143051,"responseStart":2158.100000143051,"secureConnectionStart":259.7999999523163},{"duration":241.59999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1261.4000000953674,"connectEnd":1261.4000000953674,"connectStart":1261.4000000953674,"domainLookupEnd":1261.4000000953674,"domainLookupStart":1261.4000000953674,"fetchStart":1261.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1261.4000000953674,"responseEnd":1503,"responseStart":1503,"secureConnectionStart":1261.4000000953674},{"duration":593.5999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":1570.2000000476837,"connectEnd":1570.2000000476837,"connectStart":1570.2000000476837,"domainLookupEnd":1570.2000000476837,"domainLookupStart":1570.2000000476837,"fetchStart":1570.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":1570.2000000476837,"responseEnd":2163.7999999523163,"responseStart":2163.7999999523163,"secureConnectionStart":1570.2000000476837}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":56,"responseStart":218,"responseEnd":243,"domLoading":246,"domInteractive":2193,"domContentLoadedEventStart":2193,"domContentLoadedEventEnd":2244,"domComplete":3182,"loadEventStart":3182,"loadEventEnd":3182,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2164.600000143051},{"name":"bigPipe.sidebar-id.end","time":2165.600000143051},{"name":"bigPipe.activity-panel-pipe-id.start","time":2167.100000143051},{"name":"bigPipe.activity-panel-pipe-id.end","time":2169},{"name":"activityTabFullyLoaded","time":2266.2999999523163}],"measures":[],"correlationId":"d279e7d96faa98","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":102,"dbReadsTimeInMs":14,"dbConnsTimeInMs":23,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Affected versions determined by checking that respective versions support-files/rpm/server-postin.sh contains a chown for auth_pam_tool_dir