1 |
commit: 7e790fc6dc1d92178aaf2299a370ab0d7d2d8b1c |
2 |
Author: Brian Evans <grknight <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jul 19 13:35:43 2017 +0000 |
4 |
Commit: Brian Evans <grknight <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jul 19 13:35:43 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/mysql-extras.git/commit/?id=7e790fc6 |
7 |
|
8 |
Respin tzinfo patch for 5.6.37 |
9 |
|
10 |
20008_all_mysql-tzinfo-symlink-5.6.37.patch | 103 ++++++++++++++++++++++++++++ |
11 |
1 file changed, 103 insertions(+) |
12 |
|
13 |
diff --git a/20008_all_mysql-tzinfo-symlink-5.6.37.patch b/20008_all_mysql-tzinfo-symlink-5.6.37.patch |
14 |
new file mode 100644 |
15 |
index 0000000..1c6ed0f |
16 |
--- /dev/null |
17 |
+++ b/20008_all_mysql-tzinfo-symlink-5.6.37.patch |
18 |
@@ -0,0 +1,103 @@ |
19 |
+=== modified file 'sql/tztime.cc' |
20 |
+--- a/sql/tztime.cc 2013-05-07 11:05:09 +0000 |
21 |
++++ b/sql/tztime.cc 2013-11-13 15:16:35 +0000 |
22 |
+@@ -2494,7 +2494,7 @@ |
23 |
+ |
24 |
+ */ |
25 |
+ my_bool |
26 |
+-scan_tz_dir(char * name_end) |
27 |
++scan_tz_dir(char * name_end, uint symlink_recursion_level) |
28 |
+ { |
29 |
+ MY_DIR *cur_dir; |
30 |
+ char *name_end_tmp; |
31 |
+@@ -2514,7 +2514,32 @@ |
32 |
+ |
33 |
+ if (MY_S_ISDIR(cur_dir->dir_entry[i].mystat->st_mode)) |
34 |
+ { |
35 |
+- if (scan_tz_dir(name_end_tmp)) |
36 |
++ my_bool is_symlink; |
37 |
++ if ((is_symlink= my_is_symlink(fullname, NULL)) && |
38 |
++ symlink_recursion_level > 0) |
39 |
++ { |
40 |
++ /* |
41 |
++ The timezone definition data in some Linux distributions |
42 |
++ (e.g. the "timezone-data-2013f" package in Gentoo) |
43 |
++ may have synlimks like: |
44 |
++ /usr/share/zoneinfo/posix/ -> /usr/share/zoneinfo/, |
45 |
++ so the same timezone files are available under two names |
46 |
++ (e.g. "CET" and "posix/CET"). |
47 |
++ |
48 |
++ We allow one level of symlink recursion for backward |
49 |
++ compatibility with earlier timezone data packages that have |
50 |
++ duplicate copies of the same timezone files inside the root |
51 |
++ directory and the "posix" subdirectory (instead of symlinking). |
52 |
++ This makes "posix/CET" still available, but helps to avoid |
53 |
++ following such symlinks infinitely: |
54 |
++ /usr/share/zoneinfo/posix/posix/posix/.../posix/ |
55 |
++ */ |
56 |
++ fflush(stdout); |
57 |
++ fprintf(stderr, "Warning: Skipping directory '%s': " |
58 |
++ "to avoid infinite symlink recursion.\n", fullname); |
59 |
++ continue; |
60 |
++ } |
61 |
++ if (scan_tz_dir(name_end_tmp, symlink_recursion_level + is_symlink)) |
62 |
+ { |
63 |
+ my_dirend(cur_dir); |
64 |
+ return 1; |
65 |
+@@ -2526,14 +2551,20 @@ |
66 |
+ if (!tz_load(fullname, &tz_info, &tz_storage)) |
67 |
+ print_tz_as_sql(root_name_end + 1, &tz_info); |
68 |
+ else |
69 |
++ { |
70 |
++ fflush(stdout); |
71 |
+ fprintf(stderr, |
72 |
+ "Warning: Unable to load '%s' as time zone. Skipping it.\n", |
73 |
+ fullname); |
74 |
++ } |
75 |
+ free_root(&tz_storage, MYF(0)); |
76 |
+ } |
77 |
+ else |
78 |
++ { |
79 |
++ fflush(stdout); |
80 |
+ fprintf(stderr, "Warning: '%s' is not regular file or directory\n", |
81 |
+ fullname); |
82 |
++ } |
83 |
+ } |
84 |
+ } |
85 |
+ |
86 |
+@@ -2566,8 +2597,9 @@ |
87 |
+ printf("TRUNCATE TABLE time_zone_transition;\n"); |
88 |
+ printf("TRUNCATE TABLE time_zone_transition_type;\n"); |
89 |
+ |
90 |
+- if (scan_tz_dir(root_name_end)) |
91 |
++ if (scan_tz_dir(root_name_end, 0)) |
92 |
+ { |
93 |
++ fflush(stdout); |
94 |
+ fprintf(stderr, "There were fatal errors during processing " |
95 |
+ "of zoneinfo directory\n"); |
96 |
+ return 1; |
97 |
+@@ -2586,6 +2618,7 @@ |
98 |
+ { |
99 |
+ if (tz_load(argv[2], &tz_info, &tz_storage)) |
100 |
+ { |
101 |
++ fflush(stdout); |
102 |
+ fprintf(stderr, "Problems with zoneinfo file '%s'\n", argv[2]); |
103 |
+ return 1; |
104 |
+ } |
105 |
+@@ -2595,6 +2628,7 @@ |
106 |
+ { |
107 |
+ if (tz_load(argv[1], &tz_info, &tz_storage)) |
108 |
+ { |
109 |
++ fflush(stdout); |
110 |
+ fprintf(stderr, "Problems with zoneinfo file '%s'\n", argv[2]); |
111 |
+ return 1; |
112 |
+ } |
113 |
+@@ -2604,6 +2638,7 @@ |
114 |
+ free_root(&tz_storage, MYF(0)); |
115 |
+ } |
116 |
+ |
117 |
++ my_end(0); |
118 |
+ return 0; |
119 |
+ } |
120 |
+ |
121 |
+ |