diff options
| author | Michael Gmelin <grembo@FreeBSD.org> | 2014-05-21 10:37:51 +0000 |
|---|---|---|
| committer | Michael Gmelin <grembo@FreeBSD.org> | 2014-05-21 10:37:51 +0000 |
| commit | 3c99c665e6cf97b6985cf40d61cf921ab926c8bc (patch) | |
| tree | bf7778e24c096b3a1b0cfd4ab4cef4292d09f6f9 /databases/mariadb55-client/files | |
| parent | Fix two issues with r354638: (diff) | |
Respect hier(7) for config files
PR: ports/182547
Reviewed by: flo
Approved by: flo
Diffstat (limited to 'databases/mariadb55-client/files')
| -rw-r--r-- | databases/mariadb55-client/files/patch-mysys_default.c | 46 | ||||
| -rw-r--r-- | databases/mariadb55-client/files/pkg-message.in | 7 |
2 files changed, 45 insertions, 8 deletions
diff --git a/databases/mariadb55-client/files/patch-mysys_default.c b/databases/mariadb55-client/files/patch-mysys_default.c index 2f9596809d99..d99332492a41 100644 --- a/databases/mariadb55-client/files/patch-mysys_default.c +++ b/databases/mariadb55-client/files/patch-mysys_default.c @@ -1,5 +1,5 @@ ---- mysys/default.c.orig 2012-12-17 03:57:40.000000000 +0200 -+++ mysys/default.c 2012-12-17 04:00:28.000000000 +0200 +--- mysys/default.c.orig 2013-10-01 21:15:03.544135869 +0200 ++++ mysys/default.c 2013-10-01 21:15:38.871375504 +0200 @@ -89,7 +89,7 @@ /* Which directories are searched for options (and in which order) */ @@ -18,11 +18,41 @@ /* Ignore world-writable regular files. This is mainly done to protect us to not read a file created by -@@ -1229,6 +1229,7 @@ - #if defined(DEFAULT_SYSCONFDIR) - if (DEFAULT_SYSCONFDIR[0]) - errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs); -+ errors += add_directory(alloc, DEFAULT_SYSCONFDIR "/mysql", dirs); - #endif /* DEFAULT_SYSCONFDIR */ +@@ -803,6 +803,14 @@ + if (!(fp= mysql_file_fopen(key_file_cnf, name, O_RDONLY, MYF(0)))) + return 1; /* Ignore wrong files */ + ++ if (strstr(name, "/etc") == name) ++ { ++ fprintf(stderr, ++ "error: Config file %s in invalid location, please move to or merge with %%PREFIX%%%s\n", ++ name,name); ++ goto err; ++ } ++ + while (mysql_file_fgets(buff, sizeof(buff) - 1, fp)) + { + line++; +@@ -1067,7 +1067,8 @@ + if (name[0] == FN_HOMELIB) /* Add . to filenames in home */ + *end++= '.'; + strxmov(end, conf_file, *ext, " ", NullS); +- fputs(name, stdout); ++ if (strstr(name, "/etc") != name) ++ fputs(name, stdout); + } + } + } +@@ -1226,10 +1226,8 @@ + errors += add_directory(alloc, "/etc/", dirs); + errors += add_directory(alloc, "/etc/mysql/", dirs); + +-#if defined(DEFAULT_SYSCONFDIR) +- if (DEFAULT_SYSCONFDIR[0]) +- errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs); +-#endif /* DEFAULT_SYSCONFDIR */ ++ errors += add_directory(alloc, "%%PREFIX%%/etc/", dirs); ++ errors += add_directory(alloc, "%%PREFIX%%/etc/mysql/", dirs); #endif + diff --git a/databases/mariadb55-client/files/pkg-message.in b/databases/mariadb55-client/files/pkg-message.in new file mode 100644 index 000000000000..8bea32f83491 --- /dev/null +++ b/databases/mariadb55-client/files/pkg-message.in @@ -0,0 +1,7 @@ +************************************************************************ + +MariaDB respects hier(7) and doesn't check /etc and /etc/mysql for +my.cnf. Please move existing my.cnf files from those paths to +%%PREFIX%%/etc and %%PREFIX%%/etc/mysql. + +************************************************************************ |
