Changeset View
Changeset View
Standalone View
Standalone View
databases/mariadb100-server/files/patch-mysys_my__default.c
--- mysys/my_default.c.orig 2014-08-09 00:13:39.000000000 +0200 | --- mysys/my_default.c.orig 2015-06-17 14:54:12 UTC | ||||
+++ mysys/my_default.c 2014-09-05 19:56:48.006019959 +0200 | +++ mysys/my_default.c | ||||
@@ -90,7 +90,7 @@ | @@ -90,7 +90,7 @@ static my_bool defaults_already_read= FA | ||||
/* Which directories are searched for options (and in which order) */ | /* Which directories are searched for options (and in which order) */ | ||||
-#define MAX_DEFAULT_DIRS 6 | -#define MAX_DEFAULT_DIRS 6 | ||||
+#define MAX_DEFAULT_DIRS 7 | +#define MAX_DEFAULT_DIRS 7 | ||||
#define DEFAULT_DIRS_SIZE (MAX_DEFAULT_DIRS + 1) /* Terminate with NULL */ | #define DEFAULT_DIRS_SIZE (MAX_DEFAULT_DIRS + 1) /* Terminate with NULL */ | ||||
static const char **default_directories = NULL; | static const char **default_directories = NULL; | ||||
@@ -785,7 +785,7 @@ | @@ -785,7 +785,7 @@ static int search_default_file_with_ext( | ||||
{ | { | ||||
MY_STAT stat_info; | MY_STAT stat_info; | ||||
if (!my_stat(name,&stat_info,MYF(0))) | if (!my_stat(name,&stat_info,MYF(0))) | ||||
- return 1; | - return 1; | ||||
+ return 0; | + return 0; | ||||
vsevolod: This change is very strange. | |||||
Not Done Inline ActionsInherited from the mariadb55-server port brnrd: Inherited from the mariadb55-server port | |||||
Not Done Inline ActionsTraced this back to MySQL 5.1 source brnrd: Traced this back to MySQL 5.1 source | |||||
/* | /* | ||||
Ignore world-writable regular files. | Ignore world-writable regular files. | ||||
This is mainly done to protect us to not read a file created by | This is mainly done to protect us to not read a file created by | ||||
@@ -803,6 +803,14 @@ | @@ -803,6 +803,14 @@ static int search_default_file_with_ext( | ||||
if (!(fp= mysql_file_fopen(key_file_cnf, name, O_RDONLY, MYF(0)))) | if (!(fp= mysql_file_fopen(key_file_cnf, name, O_RDONLY, MYF(0)))) | ||||
return 1; /* Ignore wrong files */ | return 1; /* Ignore wrong files */ | ||||
+ if (strstr(name, "/etc") == name) | + if (strstr(name, "/etc") == name) | ||||
Not Done Inline ActionsI don't understand this change. Is it legal? vsevolod: I don't understand this change. Is it legal? | |||||
Not Done Inline Actionscheck the pkg-message, "MariaDB respects hier(7) and doesn't check /etc and /etc/mysql for my.cnf" brnrd: check the pkg-message, "MariaDB respects hier(7) and doesn't check /etc and /etc/mysql for my. | |||||
+ { | + { | ||||
+ fprintf(stderr, | + fprintf(stderr, | ||||
+ "error: Config file %s in invalid location, please move to or merge with /usr/local%s\n", | + "error: Config file %s in invalid location, please move to or merge with /usr/local%s\n", | ||||
+ name,name); | + name,name); | ||||
+ goto err; | + goto err; | ||||
+ } | + } | ||||
+ | + | ||||
while (mysql_file_fgets(buff, sizeof(buff) - 1, fp)) | while (mysql_file_fgets(buff, sizeof(buff) - 1, fp)) | ||||
{ | { | ||||
line++; | line++; | ||||
@@ -1067,7 +1075,8 @@ | @@ -1067,7 +1075,8 @@ void my_print_default_files(const char * | ||||
if (name[0] == FN_HOMELIB) /* Add . to filenames in home */ | if (name[0] == FN_HOMELIB) /* Add . to filenames in home */ | ||||
*end++= '.'; | *end++= '.'; | ||||
strxmov(end, conf_file, *ext, " ", NullS); | strxmov(end, conf_file, *ext, " ", NullS); | ||||
- fputs(name, stdout); | - fputs(name, stdout); | ||||
+ if (strstr(name, "/etc") != name) | + if (strstr(name, "/etc") != name) | ||||
+ fputs(name, stdout); | + fputs(name, stdout); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -1223,13 +1232,10 @@ | @@ -1223,13 +1232,10 @@ static const char **init_default_directo | ||||
#else | #else | ||||
-#if defined(DEFAULT_SYSCONFDIR) | -#if defined(DEFAULT_SYSCONFDIR) | ||||
- if (DEFAULT_SYSCONFDIR[0]) | - if (DEFAULT_SYSCONFDIR[0]) | ||||
- errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs); | - errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs); | ||||
-#else | -#else | ||||
errors += add_directory(alloc, "/etc/", dirs); | errors += add_directory(alloc, "/etc/", dirs); | ||||
errors += add_directory(alloc, "/etc/mysql/", dirs); | errors += add_directory(alloc, "/etc/mysql/", dirs); | ||||
-#endif /* DEFAULT_SYSCONFDIR */ | -#endif /* DEFAULT_SYSCONFDIR */ | ||||
+ errors += add_directory(alloc, "/usr/local/etc/", dirs); | + errors += add_directory(alloc, "/usr/local/etc/", dirs); | ||||
+ errors += add_directory(alloc, "/usr/local/etc/mysql/", dirs); | + errors += add_directory(alloc, "/usr/local/etc/mysql/", dirs); | ||||
#endif | #endif | ||||
This change is very strange.