server
server copied to clipboard
Make sure "logger" message arguments are not interpreted as command line switches
trafficstars
- [x] The Jira issue number for this PR is: MDEV-34847
Description
There was a case where logger would report "invalid option 'r'" as the actual output was "ls -l" output
Properly quoting the subshell output, and adding '--' before the message argument to make sure it does not get interpreted as command line switch even when starting with a '-', prevents this from happening again.
Release Notes
Not relevant enough to be mentioned in release notes I say.
How can this PR be tested?
I only noticed this when trying to upgrade a Galera cluster from 10.x to 11.x, had never seen the "invalid option" output in error logs before. So it is rather tricky to actually test, but should be easy to be reviewed as it is just basic shell stuff.
Basing the PR against the correct MariaDB version
- [ ] This is a new feature or a refactoring, and the PR is based against the
mainbranch. - [x] This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.
PR quality check
- [x] I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
- [x] For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.