summaryrefslogtreecommitdiff
path: root/scripts/mysqlaccess.sh
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-08-03 17:13:56 +0200
committerSergei Golubchik <sergii@pisem.net>2014-08-03 17:13:56 +0200
commit91c47e6fdf9aff728761177aff731442efc5ab29 (patch)
tree042a0181f419e6d69e67dfcae1ce612757a6e210 /scripts/mysqlaccess.sh
parent82ce2a2503a95e8bdc76c351a87e98c93445a433 (diff)
downloadmariadb-git-91c47e6fdf9aff728761177aff731442efc5ab29.tar.gz
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.
Diffstat (limited to 'scripts/mysqlaccess.sh')
-rw-r--r--scripts/mysqlaccess.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh
index 1d01c84735a..d8fd239585c 100644
--- a/scripts/mysqlaccess.sh
+++ b/scripts/mysqlaccess.sh
@@ -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");
}