fontconfig: needs host-gperf
[buildroot-gz.git] / package / acl / 0002-add-__acl_-prefixes-to-internal-symbols.patch
blobf9a5d9bd1e8dfc1144e8538a56f12445855dbbf4
1 From debbe4f7b591b3f35d0ed65c17fa81b196b2eb2d Mon Sep 17 00:00:00 2001
2 From: Mike Frysinger <vapier@gentoo.org>
3 Date: Tue, 12 Aug 2014 08:37:25 -0400
4 Subject: [PATCH] add __acl_ prefixes to internal symbols
6 When static linking libacl, people sometimes run into symbol collisions
7 because their own code defines symbols like "quote". So for acl internal
8 symbols, use an __acl_ prefix.
10 [Rahul Bedarkar: backported from upstream
11 http://git.savannah.gnu.org/cgit/acl.git/commit/?id=a2c4d71c2e84419a49db503ed59de4d3d1dca7dd ]
12 Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
13 ---
14 exports | 12 ++----------
15 getfacl/getfacl.c | 4 ++--
16 include/misc.h | 8 ++++----
17 libacl/__acl_to_any_text.c | 4 ++--
18 libacl/acl_from_text.c | 4 ++--
19 libmisc/high_water_alloc.c | 2 +-
20 libmisc/next_line.c | 6 +++---
21 libmisc/quote.c | 4 ++--
22 libmisc/unquote.c | 2 +-
23 setfacl/parse.c | 10 +++++-----
24 setfacl/setfacl.c | 4 ++--
25 11 files changed, 26 insertions(+), 34 deletions(-)
27 diff --git a/exports b/exports
28 index 7d8e69e..bf15d84 100644
29 --- a/exports
30 +++ b/exports
31 @@ -59,22 +59,14 @@ ACL_1.0 {
32 acl_to_any_text;
34 local:
35 - # Library internal stuff
36 + # Library internal stuff
37 __new_var_obj_p;
38 __new_obj_p_here;
39 __free_obj_p;
40 __check_obj_p;
41 __ext2int_and_check;
42 - __acl_reorder_entry_obj_p;
43 - __acl_reorder_obj_p;
44 - __acl_init_obj;
45 - __acl_create_entry_obj;
46 - __acl_free_acl_obj;
47 - __acl_to_any_text;
48 + __acl_*;
49 __apply_mask_to_mode;
51 - quote;
52 - unquote;
55 ACL_1.1 {
56 diff --git a/getfacl/getfacl.c b/getfacl/getfacl.c
57 index f8eaf25..af9e225 100644
58 --- a/getfacl/getfacl.c
59 +++ b/getfacl/getfacl.c
60 @@ -90,7 +90,7 @@ int opt_numeric; /* don't convert id's to symbolic names */
62 static const char *xquote(const char *str, const char *quote_chars)
64 - const char *q = quote(str, quote_chars);
65 + const char *q = __acl_quote(str, quote_chars);
66 if (q == NULL) {
67 fprintf(stderr, "%s: %s\n", progname, strerror(errno));
68 exit(1);
69 @@ -718,7 +718,7 @@ int main(int argc, char *argv[])
70 do {
71 if (optind == argc ||
72 strcmp(argv[optind], "-") == 0) {
73 - while ((line = next_line(stdin)) != NULL) {
74 + while ((line = __acl_next_line(stdin)) != NULL) {
75 if (*line == '\0')
76 continue;
78 diff --git a/include/misc.h b/include/misc.h
79 index 0c5fdcc..c25accf 100644
80 --- a/include/misc.h
81 +++ b/include/misc.h
82 @@ -15,9 +15,9 @@
83 along with this program. If not, see <http://www.gnu.org/licenses/>.
86 -extern int high_water_alloc(void **buf, size_t *bufsize, size_t newsize);
87 +extern int __acl_high_water_alloc(void **buf, size_t *bufsize, size_t newsize);
89 -extern const char *quote(const char *str, const char *quote_chars);
90 -extern char *unquote(char *str);
91 +extern const char *__acl_quote(const char *str, const char *quote_chars);
92 +extern char *__acl_unquote(char *str);
94 -extern char *next_line(FILE *file);
95 +extern char *__acl_next_line(FILE *file);
96 diff --git a/libacl/__acl_to_any_text.c b/libacl/__acl_to_any_text.c
97 index a4f9c34..19f1ccc 100644
98 --- a/libacl/__acl_to_any_text.c
99 +++ b/libacl/__acl_to_any_text.c
100 @@ -159,7 +159,7 @@ acl_entry_to_any_str(const acl_entry_t entry_d, char *text_p, ssize_t size,
101 if (options & TEXT_NUMERIC_IDS)
102 str = NULL;
103 else
104 - str = quote(user_name(
105 + str = __acl_quote(user_name(
106 entry_obj_p->eid.qid), ":, \t\n\r");
107 if (str != NULL) {
108 strncpy(text_p, str, size);
109 @@ -182,7 +182,7 @@ acl_entry_to_any_str(const acl_entry_t entry_d, char *text_p, ssize_t size,
110 if (options & TEXT_NUMERIC_IDS)
111 str = NULL;
112 else
113 - str = quote(group_name(
114 + str = __acl_quote(group_name(
115 entry_obj_p->eid.qid), ":, \t\n\r");
116 if (str != NULL) {
117 strncpy(text_p, str, size);
118 diff --git a/libacl/acl_from_text.c b/libacl/acl_from_text.c
119 index 1e05322..f6165be 100644
120 --- a/libacl/acl_from_text.c
121 +++ b/libacl/acl_from_text.c
122 @@ -206,7 +206,7 @@ parse_acl_entry(const char **text_p, acl_t *acl_p)
123 str = get_token(text_p);
124 if (str) {
125 entry_obj.etag = ACL_USER;
126 - error = get_uid(unquote(str),
127 + error = get_uid(__acl_unquote(str),
128 &entry_obj.eid.qid);
129 free(str);
130 if (error) {
131 @@ -225,7 +225,7 @@ parse_acl_entry(const char **text_p, acl_t *acl_p)
132 str = get_token(text_p);
133 if (str) {
134 entry_obj.etag = ACL_GROUP;
135 - error = get_gid(unquote(str),
136 + error = get_gid(__acl_unquote(str),
137 &entry_obj.eid.qid);
138 free(str);
139 if (error) {
140 diff --git a/libmisc/high_water_alloc.c b/libmisc/high_water_alloc.c
141 index c127dc1..951f4bb 100644
142 --- a/libmisc/high_water_alloc.c
143 +++ b/libmisc/high_water_alloc.c
144 @@ -21,7 +21,7 @@
145 #include <stdlib.h>
146 #include "misc.h"
148 -int high_water_alloc(void **buf, size_t *bufsize, size_t newsize)
149 +int __acl_high_water_alloc(void **buf, size_t *bufsize, size_t newsize)
151 #define CHUNK_SIZE 256
153 diff --git a/libmisc/next_line.c b/libmisc/next_line.c
154 index 0566d7a..126a364 100644
155 --- a/libmisc/next_line.c
156 +++ b/libmisc/next_line.c
157 @@ -23,7 +23,7 @@
159 #define LINE_SIZE getpagesize()
161 -char *next_line(FILE *file)
162 +char *__acl_next_line(FILE *file)
164 static char *line;
165 static size_t line_size;
166 @@ -31,7 +31,7 @@ char *next_line(FILE *file)
167 int eol = 0;
169 if (!line) {
170 - if (high_water_alloc((void **)&line, &line_size, LINE_SIZE))
171 + if (__acl_high_water_alloc((void **)&line, &line_size, LINE_SIZE))
172 return NULL;
174 c = line;
175 @@ -47,7 +47,7 @@ char *next_line(FILE *file)
176 if (feof(file))
177 break;
178 if (!eol) {
179 - if (high_water_alloc((void **)&line, &line_size,
180 + if (__acl_high_water_alloc((void **)&line, &line_size,
181 2 * line_size))
182 return NULL;
183 c = strrchr(line, '\0');
184 diff --git a/libmisc/quote.c b/libmisc/quote.c
185 index bf8f9eb..a28800c 100644
186 --- a/libmisc/quote.c
187 +++ b/libmisc/quote.c
188 @@ -23,7 +23,7 @@
189 #include <string.h>
190 #include "misc.h"
192 -const char *quote(const char *str, const char *quote_chars)
193 +const char *__acl_quote(const char *str, const char *quote_chars)
195 static char *quoted_str;
196 static size_t quoted_str_len;
197 @@ -40,7 +40,7 @@ const char *quote(const char *str, const char *quote_chars)
198 if (nonpr == 0)
199 return str;
201 - if (high_water_alloc((void **)&quoted_str, &quoted_str_len,
202 + if (__acl_high_water_alloc((void **)&quoted_str, &quoted_str_len,
203 (s - (unsigned char *)str) + nonpr * 3 + 1))
204 return NULL;
205 for (s = (unsigned char *)str, q = quoted_str; *s != '\0'; s++) {
206 diff --git a/libmisc/unquote.c b/libmisc/unquote.c
207 index bffebf9..4f4ce7c 100644
208 --- a/libmisc/unquote.c
209 +++ b/libmisc/unquote.c
210 @@ -22,7 +22,7 @@
211 #include <ctype.h>
212 #include "misc.h"
214 -char *unquote(char *str)
215 +char *__acl_unquote(char *str)
217 unsigned char *s, *t;
219 diff --git a/setfacl/parse.c b/setfacl/parse.c
220 index e7e6add..7433459 100644
221 --- a/setfacl/parse.c
222 +++ b/setfacl/parse.c
223 @@ -226,7 +226,7 @@ user_entry:
224 str = get_token(text_p);
225 if (str) {
226 cmd->c_tag = ACL_USER;
227 - error = get_uid(unquote(str), &cmd->c_id);
228 + error = get_uid(__acl_unquote(str), &cmd->c_id);
229 free(str);
230 if (error) {
231 *text_p = backup;
232 @@ -245,7 +245,7 @@ user_entry:
233 str = get_token(text_p);
234 if (str) {
235 cmd->c_tag = ACL_GROUP;
236 - error = get_gid(unquote(str), &cmd->c_id);
237 + error = get_gid(__acl_unquote(str), &cmd->c_id);
238 free(str);
239 if (error) {
240 *text_p = backup;
241 @@ -466,7 +466,7 @@ read_acl_comments(
242 if (strncmp(cp, "file:", 5) == 0) {
243 cp += 5;
244 SKIP_WS(cp);
245 - cp = unquote(cp);
246 + cp = __acl_unquote(cp);
248 if (path_p) {
249 if (*path_p)
250 @@ -483,7 +483,7 @@ read_acl_comments(
251 if (uid_p) {
252 if (*uid_p != ACL_UNDEFINED_ID)
253 goto fail;
254 - if (get_uid(unquote(cp), uid_p) != 0)
255 + if (get_uid(__acl_unquote(cp), uid_p) != 0)
256 continue;
258 } else if (strncmp(cp, "group:", 6) == 0) {
259 @@ -493,7 +493,7 @@ read_acl_comments(
260 if (gid_p) {
261 if (*gid_p != ACL_UNDEFINED_ID)
262 goto fail;
263 - if (get_gid(unquote(cp), gid_p) != 0)
264 + if (get_gid(__acl_unquote(cp), gid_p) != 0)
265 continue;
267 } else if (strncmp(cp, "flags:", 6) == 0) {
268 diff --git a/setfacl/setfacl.c b/setfacl/setfacl.c
269 index 81062a6..fb2d172 100644
270 --- a/setfacl/setfacl.c
271 +++ b/setfacl/setfacl.c
272 @@ -92,7 +92,7 @@ int promote_warning;
274 static const char *xquote(const char *str, const char *quote_chars)
276 - const char *q = quote(str, quote_chars);
277 + const char *q = __acl_quote(str, quote_chars);
278 if (q == NULL) {
279 fprintf(stderr, "%s: %s\n", progname, strerror(errno));
280 exit(1);
281 @@ -311,7 +311,7 @@ int next_file(const char *arg, seq_t seq)
282 args.seq = seq;
284 if (strcmp(arg, "-") == 0) {
285 - while ((line = next_line(stdin)))
286 + while ((line = __acl_next_line(stdin)))
287 errors = walk_tree(line, walk_flags, 0, do_set, &args);
288 if (!feof(stdin)) {
289 fprintf(stderr, _("%s: Standard input: %s\n"),
291 2.6.2