1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-6485 Hard-coded paths in the source cannot be opt-out

when looking for my.cnf files: if DEFAULT_SYSCONFDIR (or INSTALL_SYSCONFDIR)
is specified (for rpms it always is), use that instead of hardcoded /etc path.
This commit is contained in:
Sergei Golubchik
2014-08-03 17:13:56 +02:00
parent 82ce2a2503
commit 91c47e6fdf
5 changed files with 25 additions and 42 deletions

View File

@ -261,12 +261,12 @@ Release Notes:
* log-file for debug-output : /tmp/mysqlaccess.log
* default values are read from a configuration file $script.conf
first this file is looked for in the current directory; if not
found it is looked for in /etc/
found it is looked for in @sysconfdir@
Note that when default-values are given, these can't get overriden
by empty (blanc) values!
* CGI-BIN version with HTML and forms interface. Simply place the
script in an ScriptAliased directory, make the configuration file
available in the that directory or in /etc, and point your browser
available in the that directory or in @sysconfdir@, and point your browser
to the right URL.
* copy the grant-rules to temporary tables, where you are safe to
play with them.
@ -480,12 +480,12 @@ MySQLaccess::Report::Print_Header();
if (-f "./$script_conf") {
require "./$script_conf";
}
elsif (-f "@prefix@/$script_conf") {
require "@prefix@/$script_conf";
}
elsif (-f "@sysconfdir@/$script_conf") {
require "@sysconfdir@/$script_conf";
}
elsif (-f "/etc/$script_conf") {
require "/etc/$script_conf";
}
# ****************************
# Read in all parameters
@ -950,8 +950,8 @@ sub MergeConfigFile {
# =================================
sub MergeConfigFiles {
my ($name,$pass,$uid,$gid,$quota,$comment,$gcos,$dir,$shell) = getpwuid $<;
MergeConfigFile("@prefix@/my.cnf");
MergeConfigFile("@sysconfdir@/my.cnf");
MergeConfigFile("/etc/my.cnf");
MergeConfigFile("$dir/.my.cnf");
}