Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/glibc/2.9: 0050_all_glibc-_nss_dns_gethostbyaddr2_r-check-and-adjust-the-buffer-alignment.patch 0051_all_glibc-2.9-add_prio-macros.patch 0052_all_glibc-2.9-regex-BZ9697.patch 0053_all_glibc-2.9-regex-BZ697.patch
Date: Sat, 10 Jan 2009 09:55:37
Message-Id: E1LLaZ5-0001HX-V2@stork.gentoo.org
1 vapier 09/01/10 09:55:35
2
3 Added:
4 0050_all_glibc-_nss_dns_gethostbyaddr2_r-check-and-adjust-the-buffer-alignment.patch
5 0051_all_glibc-2.9-add_prio-macros.patch
6 0052_all_glibc-2.9-regex-BZ9697.patch
7 0053_all_glibc-2.9-regex-BZ697.patch
8 Log:
9 add some fixes from mainline
10
11 Revision Changes Path
12 1.1 src/patchsets/glibc/2.9/0050_all_glibc-_nss_dns_gethostbyaddr2_r-check-and-adjust-the-buffer-alignment.patch
13
14 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.9/0050_all_glibc-_nss_dns_gethostbyaddr2_r-check-and-adjust-the-buffer-alignment.patch?rev=1.1&view=markup
15 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.9/0050_all_glibc-_nss_dns_gethostbyaddr2_r-check-and-adjust-the-buffer-alignment.patch?rev=1.1&content-type=text/plain
16
17 Index: 0050_all_glibc-_nss_dns_gethostbyaddr2_r-check-and-adjust-the-buffer-alignment.patch
18 ===================================================================
19 http://sourceware.org/ml/libc-alpha/2009-01/msg00000.html
20
21 From 8ad7030880eaa18dcabf8e284e79026301fd3fa4 Mon Sep 17 00:00:00 2001
22 From: Ulrich Drepper <drepper@××××××.com>
23 Date: Thu, 8 Jan 2009 00:02:38 +0000
24 Subject: [PATCH] (_nss_dns_gethostbyaddr2_r): Check and adjust the buffer alignment.
25
26 ---
27 resolv/nss_dns/dns-host.c | 15 ++++++++++++++-
28 1 files changed, 14 insertions(+), 1 deletions(-)
29
30 diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
31 index b8e513a..a9462ae 100644
32 --- a/resolv/nss_dns/dns-host.c
33 +++ b/resolv/nss_dns/dns-host.c
34 @@ -376,6 +376,19 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
35 int n, status;
36 int olderr = errno;
37
38 + uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
39 + buffer += pad;
40 + buflen = buflen > pad ? buflen - pad : 0;
41 +
42 + if (__builtin_expect (buflen < sizeof (struct host_data), 0))
43 + {
44 + *errnop = ERANGE;
45 + *h_errnop = NETDB_INTERNAL;
46 + return NSS_STATUS_TRYAGAIN;
47 + }
48 +
49 + host_data = (struct host_data *) buffer;
50 +
51 if (__res_maybe_init (&_res, 0) == -1)
52 return NSS_STATUS_UNAVAIL;
53
54 --
55 1.6.0.6
56
57
58
59
60 1.1 src/patchsets/glibc/2.9/0051_all_glibc-2.9-add_prio-macros.patch
61
62 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.9/0051_all_glibc-2.9-add_prio-macros.patch?rev=1.1&view=markup
63 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.9/0051_all_glibc-2.9-add_prio-macros.patch?rev=1.1&content-type=text/plain
64
65 Index: 0051_all_glibc-2.9-add_prio-macros.patch
66 ===================================================================
67 http://sourceware.org/ml/libc-alpha/2009-01/msg00003.html
68
69 From a1737958e074e8f990760acc8abeb0c23715a859 Mon Sep 17 00:00:00 2001
70 From: Roland McGrath <roland@×××.org>
71 Date: Sat, 3 Jan 2009 21:04:01 +0000
72 Subject: [PATCH] 2009-01-03 Samuel Thibault <samuel.thibault@××××××××.org>
73
74 * bits/resource.h (PRIO_PROCESS, PRIO_PGRP, PRIO_USER): Add macros.
75 ---
76 bits/resource.h | 3 +++
77 1 files changed, 3 insertions(+), 0 deletions(-)
78
79 diff --git a/bits/resource.h b/bits/resource.h
80 index 8057f5c..ef718db 100644
81 --- a/bits/resource.h
82 +++ b/bits/resource.h
83 @@ -185,6 +185,9 @@ struct rusage
84 enum __priority_which
85 {
86 PRIO_PROCESS = 0, /* WHO is a process ID. */
87 +#define PRIO_PROCESS PRIO_PROCESS
88 PRIO_PGRP = 1, /* WHO is a process group ID. */
89 +#define PRIO_PGRP PRIO_PGRP
90 PRIO_USER = 2 /* WHO is a user ID. */
91 +#define PRIO_USER PRIO_USER
92 };
93 --
94 1.6.0.6
95
96
97
98
99 1.1 src/patchsets/glibc/2.9/0052_all_glibc-2.9-regex-BZ9697.patch
100
101 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.9/0052_all_glibc-2.9-regex-BZ9697.patch?rev=1.1&view=markup
102 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.9/0052_all_glibc-2.9-regex-BZ9697.patch?rev=1.1&content-type=text/plain
103
104 Index: 0052_all_glibc-2.9-regex-BZ9697.patch
105 ===================================================================
106 http://sourceware.org/ml/libc-alpha/2009-01/msg00005.html
107
108 From ea8ca0dfcbf2721bcf2c08ce3c01d5764b827572 Mon Sep 17 00:00:00 2001
109 From: Ulrich Drepper <drepper@××××××.com>
110 Date: Thu, 8 Jan 2009 00:42:28 +0000
111 Subject: [PATCH] (re_compile_fastmap_iter): Rewrite COMPLEX_BRACKET handling.
112
113 ---
114 posix/regcomp.c | 79 ++++++++++++++++++++++++++++++++++--------------------
115 1 files changed, 50 insertions(+), 29 deletions(-)
116
117 diff --git a/posix/regcomp.c b/posix/regcomp.c
118 index d5a0535..4843cfe 100644
119 --- a/posix/regcomp.c
120 +++ b/posix/regcomp.c
121 @@ -350,47 +351,67 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
122 #ifdef RE_ENABLE_I18N
123 else if (type == COMPLEX_BRACKET)
124 {
125 - int i;
126 re_charset_t *cset = dfa->nodes[node].opr.mbcset;
127 - if (cset->non_match || cset->ncoll_syms || cset->nequiv_classes
128 - || cset->nranges || cset->nchar_classes)
129 - {
130 + int i;
131 +
132 # ifdef _LIBC
133 - if (_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES) != 0)
134 + /* See if we have to try all bytes which start multiple collation
135 + elements.
136 + e.g. In da_DK, we want to catch 'a' since "aa" is a valid
137 + collation element, and don't catch 'b' since 'b' is
138 + the only collation element which starts from 'b' (and
139 + it is caught by SIMPLE_BRACKET). */
140 + if (_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES) != 0
141 + && (cset->ncoll_syms || cset->nranges))
142 {
143 - /* In this case we want to catch the bytes which are
144 - the first byte of any collation elements.
145 - e.g. In da_DK, we want to catch 'a' since "aa"
146 - is a valid collation element, and don't catch
147 - 'b' since 'b' is the only collation element
148 - which starts from 'b'. */
149 const int32_t *table = (const int32_t *)
150 _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
151 for (i = 0; i < SBC_MAX; ++i)
152 if (table[i] < 0)
153 re_set_fastmap (fastmap, icase, i);
154 }
155 -# else
156 - if (dfa->mb_cur_max > 1)
157 - for (i = 0; i < SBC_MAX; ++i)
158 - if (__btowc (i) == WEOF)
159 - re_set_fastmap (fastmap, icase, i);
160 -# endif /* not _LIBC */
161 - }
162 - for (i = 0; i < cset->nmbchars; ++i)
163 +# endif /* _LIBC */
164 +
165 + /* See if we have to start the match at all multibyte characters,
166 + i.e. where we would not find an invalid sequence. This only
167 + applies to multibyte character sets; for single byte character
168 + sets, the SIMPLE_BRACKET again suffices. */
169 + if (dfa->mb_cur_max > 1
170 + && (cset->nchar_classes || cset->non_match
171 +# ifdef _LIBC
172 + || cset->nequiv_classes
173 +# endif /* _LIBC */
174 + ))
175 {
176 - char buf[256];
177 - mbstate_t state;
178 - memset (&state, '\0', sizeof (state));
179 - if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1)
180 - re_set_fastmap (fastmap, icase, *(unsigned char *) buf);
181 - if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1)
182 + unsigned char c = 0;
183 + do
184 {
185 - if (__wcrtomb (buf, towlower (cset->mbchars[i]), &state)
186 - != (size_t) -1)
187 - re_set_fastmap (fastmap, 0, *(unsigned char *) buf);
188 + mbstate_t mbs;
189 + memset (&mbs, 0, sizeof (mbs));
190 + if (__mbrtowc (NULL, (char *) &c, 1, &mbs) == (size_t) -2)
191 + re_set_fastmap (fastmap, false, (int) c);
192 }
193 + while (++c != 0);
194 }
195 +
196 + else
197 + {
198 + /* ... Else catch all bytes which can start the mbchars. */
199 + for (i = 0; i < cset->nmbchars; ++i)
200 + {
201 + char buf[256];
202 + mbstate_t state;
203 + memset (&state, '\0', sizeof (state));
204 + if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1)
205 + re_set_fastmap (fastmap, icase, *(unsigned char *) buf);
206 + if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1)
207 + {
208 + if (__wcrtomb (buf, towlower (cset->mbchars[i]), &state)
209 + != (size_t) -1)
210 + re_set_fastmap (fastmap, false, *(unsigned char *) buf);
211 + }
212 + }
213 + }
214 }
215 #endif /* RE_ENABLE_I18N */
216 else if (type == OP_PERIOD
217 --
218 1.6.0.6
219
220
221
222
223 1.1 src/patchsets/glibc/2.9/0053_all_glibc-2.9-regex-BZ697.patch
224
225 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.9/0053_all_glibc-2.9-regex-BZ697.patch?rev=1.1&view=markup
226 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.9/0053_all_glibc-2.9-regex-BZ697.patch?rev=1.1&content-type=text/plain
227
228 Index: 0053_all_glibc-2.9-regex-BZ697.patch
229 ===================================================================
230 http://sourceware.org/ml/libc-alpha/2009-01/msg00006.html
231
232 From 37bdc055ceeb6b1144c07448a7210d9ab3fbb2f5 Mon Sep 17 00:00:00 2001
233 From: Ulrich Drepper <drepper@××××××.com>
234 Date: Thu, 8 Jan 2009 00:47:05 +0000
235 Subject: [PATCH] (prune_impossible_nodes): Handle sifted_states[0] being NULL also if
236 there are no backreferences.
237
238 ---
239 posix/regexec.c | 7 ++++++-
240 1 files changed, 6 insertions(+), 1 deletions(-)
241
242 diff --git a/posix/regexec.c b/posix/regexec.c
243 index 135efe7..7bf0c08 100644
244 --- a/posix/regexec.c
245 +++ b/posix/regexec.c
246 @@ -1004,6 +1004,11 @@ prune_impossible_nodes (mctx)
247 re_node_set_free (&sctx.limits);
248 if (BE (ret != REG_NOERROR, 0))
249 goto free_return;
250 + if (sifted_states[0] == NULL)
251 + {
252 + ret = REG_NOMATCH;
253 + goto free_return;
254 + }
255 }
256 re_free (mctx->state_log);
257 mctx->state_log = sifted_states;
258 --
259 1.6.0.6