Lines 9-26
Link Here
|
9 |
#define DEFAULT_DIRS_SIZE (MAX_DEFAULT_DIRS + 1) /* Terminate with NULL */ |
9 |
#define DEFAULT_DIRS_SIZE (MAX_DEFAULT_DIRS + 1) /* Terminate with NULL */ |
10 |
static const char **default_directories = NULL; |
10 |
static const char **default_directories = NULL; |
11 |
|
11 |
|
12 |
@@ -1409,7 +1409,10 @@ static const char **init_default_directo |
12 |
@@ -909,6 +909,14 @@ |
|
|
13 |
return 1; /* Ignore wrong files */ |
14 |
} |
13 |
|
15 |
|
14 |
#if defined(DEFAULT_SYSCONFDIR) |
16 |
+ if (strstr(name, "/etc") == name) |
15 |
if (DEFAULT_SYSCONFDIR[0]) |
|
|
16 |
+ { |
17 |
+ { |
17 |
errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs); |
18 |
+ fprintf(stderr, |
18 |
+ errors += add_directory(alloc, DEFAULT_SYSCONFDIR "/mysql", dirs); |
19 |
+ "error: Config file %s in invalid location, please move to or merge with /usr/local%s\n", |
|
|
20 |
+ name,name); |
21 |
+ goto err; |
19 |
+ } |
22 |
+ } |
20 |
#endif /* DEFAULT_SYSCONFDIR */ |
23 |
+ |
|
|
24 |
while (mysql_file_getline(buff, sizeof(buff) - 1, fp)) |
25 |
{ |
26 |
line++; |
27 |
@@ -1245,7 +1253,8 @@ |
28 |
end[(strlen(end)-1)] = ' '; |
29 |
else |
30 |
strxmov(end, conf_file, *ext , " ", NullS); |
31 |
- fputs(name, stdout); |
32 |
+ if (strstr(name, "/etc") != name) |
33 |
+ fputs(name, stdout); |
34 |
} |
35 |
} |
36 |
} |
37 |
@@ -1404,13 +1413,8 @@ |
38 |
|
39 |
#else |
40 |
|
41 |
- errors += add_directory(alloc, "/etc/", dirs); |
42 |
- errors += add_directory(alloc, "/etc/mysql/", dirs); |
43 |
- |
44 |
-#if defined(DEFAULT_SYSCONFDIR) |
45 |
- if (DEFAULT_SYSCONFDIR[0]) |
46 |
- errors += add_directory(alloc, DEFAULT_SYSCONFDIR, dirs); |
47 |
-#endif /* DEFAULT_SYSCONFDIR */ |
48 |
+ errors += add_directory(alloc, "/usr/local/etc/", dirs); |
49 |
+ errors += add_directory(alloc, "/usr/local/etc/mysql/", dirs); |
21 |
|
50 |
|
22 |
#endif |
51 |
#endif |
23 |
@@ -1480,7 +1483,7 @@ int check_file_permissions(const char *f |
52 |
|
|
|
53 |
@@ -1480,7 +1484,7 @@ |
24 |
MY_STAT stat_info; |
54 |
MY_STAT stat_info; |
25 |
|
55 |
|
26 |
if (!my_stat(file_name,&stat_info,MYF(0))) |
56 |
if (!my_stat(file_name,&stat_info,MYF(0))) |