diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2010-10-16 18:05:08 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2010-10-18 09:55:46 +0000 |
commit | cdd4e669c1f7cbe20abd38e3cfdea614c6f647bc (patch) | |
tree | a3a8d9cd4cdea27d571963435e6892d4ce31a8f4 | |
parent | 35472b3bc1109dcf71b3175ded6ce29b13a6aa63 (diff) | |
download | alpine_aports-cdd4e669c1f7cbe20abd38e3cfdea614c6f647bc.tar.bz2 alpine_aports-cdd4e669c1f7cbe20abd38e3cfdea614c6f647bc.tar.xz alpine_aports-cdd4e669c1f7cbe20abd38e3cfdea614c6f647bc.zip |
main/libc0.9.32: upgrade to new snapshot
(cherry picked from commit 2a08b9afadac83dfcf4c786fa59c2fd40e7650cd)
5 files changed, 3 insertions, 185 deletions
diff --git a/main/libc0.9.32/0001-config-parser-do-not-assume-that-realloc-return-same.patch b/main/libc0.9.32/0001-config-parser-do-not-assume-that-realloc-return-same.patch deleted file mode 100644 index bc08616fdf..0000000000 --- a/main/libc0.9.32/0001-config-parser-do-not-assume-that-realloc-return-same.patch +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | From 46db9fdff735edfda088b06d619d23dec2fc3e7a Mon Sep 17 00:00:00 2001 | ||
2 | From: Natanael Copa <natanael.copa@gmail.com> | ||
3 | Date: Thu, 16 Sep 2010 08:23:34 +0000 | ||
4 | Subject: [PATCH 1/3] config parser: do not assume that realloc return same pointer | ||
5 | |||
6 | We need to update the parser->line pointer on realloc and do not | ||
7 | initialize the token array til after the potensial realloc in | ||
8 | bb_get_chunk_with_continuation(). | ||
9 | |||
10 | While here, also replace a realloc() with malloc() where pointer always | ||
11 | is NULL. | ||
12 | |||
13 | Signed-off-by: Natanael Copa <natanael.copa@gmail.com> | ||
14 | --- | ||
15 | libc/misc/internals/parse_config.c | 9 ++++----- | ||
16 | 1 files changed, 4 insertions(+), 5 deletions(-) | ||
17 | |||
18 | diff --git a/libc/misc/internals/parse_config.c b/libc/misc/internals/parse_config.c | ||
19 | index 8fa324e..6734f35 100644 | ||
20 | --- a/libc/misc/internals/parse_config.c | ||
21 | +++ b/libc/misc/internals/parse_config.c | ||
22 | @@ -78,6 +78,7 @@ static off_t bb_get_chunk_with_continuation(parser_t* parsr) | ||
23 | parsr->line_len += PAGE_SIZE; | ||
24 | parsr->data = realloc(parsr->data, | ||
25 | parsr->data_len + parsr->line_len); | ||
26 | + parsr->line = parsr->data + parsr->data_len; | ||
27 | } | ||
28 | } | ||
29 | return pos; | ||
30 | @@ -186,23 +187,21 @@ again: | ||
31 | parser->line_len = 81; | ||
32 | if (parser->data_len == 0) | ||
33 | parser->data_len += 1 + ntokens * sizeof(char *); | ||
34 | - parser->data = realloc(parser->data, | ||
35 | - parser->data_len + parser->line_len); | ||
36 | + parser->data = malloc(parser->data_len + parser->line_len); | ||
37 | if (parser->data == NULL) | ||
38 | return 0; | ||
39 | parser->allocated |= 1; | ||
40 | } /* else { assert(parser->data_len > 0); } */ | ||
41 | if (parser->line == NULL) | ||
42 | parser->line = parser->data + parser->data_len; | ||
43 | - if (*tokens == NULL) | ||
44 | - *tokens = (char **) parser->data; | ||
45 | - memset(*tokens, 0, sizeof(*tokens[0]) * ntokens); | ||
46 | /*config_free_data(parser);*/ | ||
47 | |||
48 | /* Read one line (handling continuations with backslash) */ | ||
49 | len = bb_get_chunk_with_continuation(parser); | ||
50 | if (len == -1) | ||
51 | return 0; | ||
52 | + *tokens = (char **) parser->data; | ||
53 | + memset(*tokens, 0, sizeof(*tokens[0]) * ntokens); | ||
54 | line = parser->line; | ||
55 | |||
56 | /* Skip multiple token-delimiters in the start of line? */ | ||
57 | -- | ||
58 | 1.7.2.3 | ||
59 | |||
diff --git a/main/libc0.9.32/0002-getservice-getservent_r-must-return-ERANGE-when-buff.patch b/main/libc0.9.32/0002-getservice-getservent_r-must-return-ERANGE-when-buff.patch deleted file mode 100644 index 29b8c3b3b0..0000000000 --- a/main/libc0.9.32/0002-getservice-getservent_r-must-return-ERANGE-when-buff.patch +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | From 1d1fab81f09e2472921e0b8f1897655de5f9089c Mon Sep 17 00:00:00 2001 | ||
2 | From: Natanael Copa <natanael.copa@gmail.com> | ||
3 | Date: Thu, 16 Sep 2010 11:37:39 +0000 | ||
4 | Subject: [PATCH 2/3] getservice: getservent_r must return ERANGE when buffer is too small | ||
5 | |||
6 | This fixes issue introduced by 72e1a1ce186c39f07282398e2af9eb0253e60f15 | ||
7 | |||
8 | This should also fix the following testcase to exit with error rather | ||
9 | than cause an endless loop. | ||
10 | |||
11 | int main(void) { | ||
12 | if (getservbyname("non-existing", "udp") == NULL) | ||
13 | err(1, "getservbyname"); | ||
14 | return 0; | ||
15 | } | ||
16 | |||
17 | Reported by Pirmin Walthert | ||
18 | http://lists.uclibc.org/pipermail/uclibc/2010-August/044277.html | ||
19 | |||
20 | Signed-off-by: Natanael Copa <natanael.copa@gmail.com> | ||
21 | --- | ||
22 | libc/inet/getservice.c | 5 ++--- | ||
23 | 1 files changed, 2 insertions(+), 3 deletions(-) | ||
24 | |||
25 | diff --git a/libc/inet/getservice.c b/libc/inet/getservice.c | ||
26 | index 1532df9..ccf9816 100644 | ||
27 | --- a/libc/inet/getservice.c | ||
28 | +++ b/libc/inet/getservice.c | ||
29 | @@ -69,7 +69,7 @@ int getservent_r(struct servent *result_buf, | ||
30 | char **serv_aliases; | ||
31 | char **tok = NULL; | ||
32 | const size_t aliaslen = sizeof(*serv_aliases) * MAXALIASES; | ||
33 | - int ret = ENOENT; | ||
34 | + int ret = ERANGE; | ||
35 | |||
36 | *result = NULL; | ||
37 | if (buflen < aliaslen | ||
38 | @@ -77,7 +77,7 @@ int getservent_r(struct servent *result_buf, | ||
39 | goto DONE_NOUNLOCK; | ||
40 | |||
41 | __UCLIBC_MUTEX_LOCK(mylock); | ||
42 | - | ||
43 | + ret = ENOENT; | ||
44 | if (servp == NULL) | ||
45 | setservent(serv_stayopen); | ||
46 | if (servp == NULL) | ||
47 | @@ -88,7 +88,6 @@ int getservent_r(struct servent *result_buf, | ||
48 | servp->line_len = buflen - aliaslen; | ||
49 | /* <name>[[:space:]]<port>/<proto>[[:space:]][<aliases>] */ | ||
50 | if (!config_read(servp, &tok, MAXALIASES, 3, "# \t/", PARSE_NORMAL)) { | ||
51 | - ret = ERANGE; | ||
52 | goto DONE; | ||
53 | } | ||
54 | result_buf->s_name = *(tok++); | ||
55 | -- | ||
56 | 1.7.2.3 | ||
57 | |||
diff --git a/main/libc0.9.32/0003-config-parser-always-initialize-line-pointer.patch b/main/libc0.9.32/0003-config-parser-always-initialize-line-pointer.patch deleted file mode 100644 index 171eeee0bf..0000000000 --- a/main/libc0.9.32/0003-config-parser-always-initialize-line-pointer.patch +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | From 1f134a1d5456148e212dbe6eb69ce7bee11dc1fb Mon Sep 17 00:00:00 2001 | ||
2 | From: Natanael Copa <natanael.copa@gmail.com> | ||
3 | Date: Thu, 16 Sep 2010 11:51:21 +0000 | ||
4 | Subject: [PATCH 3/3] config parser: always initialize line pointer | ||
5 | |||
6 | We must always initialize line pointer since data pointer might | ||
7 | have changed due to a realloc (in getserv.c for example). | ||
8 | |||
9 | Signed-off-by: Natanael Copa <natanael.copa@gmail.com> | ||
10 | --- | ||
11 | libc/misc/internals/parse_config.c | 3 +-- | ||
12 | 1 files changed, 1 insertions(+), 2 deletions(-) | ||
13 | |||
14 | diff --git a/libc/misc/internals/parse_config.c b/libc/misc/internals/parse_config.c | ||
15 | index 6734f35..6d3b6f4 100644 | ||
16 | --- a/libc/misc/internals/parse_config.c | ||
17 | +++ b/libc/misc/internals/parse_config.c | ||
18 | @@ -192,8 +192,7 @@ again: | ||
19 | return 0; | ||
20 | parser->allocated |= 1; | ||
21 | } /* else { assert(parser->data_len > 0); } */ | ||
22 | - if (parser->line == NULL) | ||
23 | - parser->line = parser->data + parser->data_len; | ||
24 | + parser->line = parser->data + parser->data_len; | ||
25 | /*config_free_data(parser);*/ | ||
26 | |||
27 | /* Read one line (handling continuations with backslash) */ | ||
28 | -- | ||
29 | 1.7.2.3 | ||
30 | |||
diff --git a/main/libc0.9.32/APKBUILD b/main/libc0.9.32/APKBUILD index 9d92dc76f4..ea05f47f9e 100644 --- a/main/libc0.9.32/APKBUILD +++ b/main/libc0.9.32/APKBUILD | |||
@@ -1,9 +1,9 @@ | |||
1 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> | 1 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> |
2 | _abiver=0.9.32 | 2 | _abiver=0.9.32 |
3 | pkgname=libc$_abiver | 3 | pkgname=libc$_abiver |
4 | _gitver=1009151331 | 4 | _gitver=1010161651 |
5 | pkgver=${_abiver}_alpha0_git$_gitver | 5 | pkgver=${_abiver}_alpha0_git$_gitver |
6 | pkgrel=2 | 6 | pkgrel=0 |
7 | pkgdesc="C library for developing embedded Linux systems" | 7 | pkgdesc="C library for developing embedded Linux systems" |
8 | url=http://uclibc.org | 8 | url=http://uclibc.org |
9 | license="LGPL-2" | 9 | license="LGPL-2" |
@@ -22,12 +22,6 @@ source="http://build.alpinelinux.org:8010/distfiles/$_snapfile | |||
22 | compat-stack-guard.patch | 22 | compat-stack-guard.patch |
23 | uclibc-libm-pic.patch | 23 | uclibc-libm-pic.patch |
24 | 0001-create-DEVEL_PREFIX-MULTILIB_DIR-dir-rather-than-DEV.patch | 24 | 0001-create-DEVEL_PREFIX-MULTILIB_DIR-dir-rather-than-DEV.patch |
25 | |||
26 | 0001-config-parser-do-not-assume-that-realloc-return-same.patch | ||
27 | 0002-getservice-getservent_r-must-return-ERANGE-when-buff.patch | ||
28 | 0003-config-parser-always-initialize-line-pointer.patch | ||
29 | |||
30 | bufsize.patch | ||
31 | uclibcconfig.x86 | 25 | uclibcconfig.x86 |
32 | uclibcconfig.i486 | 26 | uclibcconfig.i486 |
33 | " | 27 | " |
@@ -116,13 +110,9 @@ utils() { | |||
116 | mv "$pkgdir"/usr/bin/* "$subpkgdir"/usr/bin/ | 110 | mv "$pkgdir"/usr/bin/* "$subpkgdir"/usr/bin/ |
117 | } | 111 | } |
118 | 112 | ||
119 | md5sums="966c830f294a8ab5069cc03a61e1b2ed libc0.9.32-0.9.32_alpha0_git1009151331.tar.bz2 | 113 | md5sums="02ab241c13849911695c31b01f98a73e libc0.9.32-0.9.32_alpha0_git1010161651.tar.bz2 |
120 | 4d408f72142ce55a0754948cc9cfe447 compat-stack-guard.patch | 114 | 4d408f72142ce55a0754948cc9cfe447 compat-stack-guard.patch |
121 | 2f9739a980be24a842c57516155c7885 uclibc-libm-pic.patch | 115 | 2f9739a980be24a842c57516155c7885 uclibc-libm-pic.patch |
122 | 9dd8192227f54d6d3ccb49dc54137ff3 0001-create-DEVEL_PREFIX-MULTILIB_DIR-dir-rather-than-DEV.patch | 116 | 9dd8192227f54d6d3ccb49dc54137ff3 0001-create-DEVEL_PREFIX-MULTILIB_DIR-dir-rather-than-DEV.patch |
123 | ba6e0370d1fc19e5903696de412507ef 0001-config-parser-do-not-assume-that-realloc-return-same.patch | ||
124 | 19d923997f9625ce6f16d8128bbcba65 0002-getservice-getservent_r-must-return-ERANGE-when-buff.patch | ||
125 | 99b817778f4ef3a1b194740ea08990b4 0003-config-parser-always-initialize-line-pointer.patch | ||
126 | cf97d904c42c5fd165650472100b18a7 bufsize.patch | ||
127 | cffecb42bdec2da7cac718fa66cacbbe uclibcconfig.x86 | 117 | cffecb42bdec2da7cac718fa66cacbbe uclibcconfig.x86 |
128 | cffecb42bdec2da7cac718fa66cacbbe uclibcconfig.i486" | 118 | cffecb42bdec2da7cac718fa66cacbbe uclibcconfig.i486" |
diff --git a/main/libc0.9.32/bufsize.patch b/main/libc0.9.32/bufsize.patch deleted file mode 100644 index b52f155c64..0000000000 --- a/main/libc0.9.32/bufsize.patch +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | diff --git a/libc/inet/getproto.c b/libc/inet/getproto.c | ||
2 | index bcf507b..9858900 100644 | ||
3 | --- a/libc/inet/getproto.c | ||
4 | +++ b/libc/inet/getproto.c | ||
5 | @@ -28,7 +28,7 @@ aliases: case sensitive optional space or tab separated list of other names | ||
6 | __UCLIBC_MUTEX_STATIC(mylock, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP); | ||
7 | |||
8 | #define MAXALIASES 35 | ||
9 | -#define BUFSZ (80) /* one line */ | ||
10 | +#define BUFSZ (256) /* one line */ | ||
11 | #define SBUFSIZE (BUFSZ + 1 + (sizeof(char *) * MAXALIASES)) | ||
12 | |||
13 | static parser_t *protop = NULL; | ||
14 | diff --git a/libc/inet/getservice.c b/libc/inet/getservice.c | ||
15 | index c38ff80..dbbc19c 100644 | ||
16 | --- a/libc/inet/getservice.c | ||
17 | +++ b/libc/inet/getservice.c | ||
18 | @@ -29,7 +29,7 @@ aliases: case sensitive optional space or tab separated list of other names | ||
19 | __UCLIBC_MUTEX_STATIC(mylock, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP); | ||
20 | |||
21 | #define MAXALIASES 35 | ||
22 | -#define BUFSZ (80) /* one line */ | ||
23 | +#define BUFSZ (256) /* one line */ | ||
24 | #define SBUFSIZE (BUFSZ + 1 + (sizeof(char *) * MAXALIASES)) | ||
25 | |||
26 | static parser_t *servp = NULL; | ||