Skip to content

Commit e685e07

Browse files
author
Ulrich Drepper
committed
Update.
2000-07-18 Mark Kettenis <[email protected]> Update resolver code to BIND 8.2.3-T5B. * resolv/Versions [GLIBC_2.2] (libc): Add __res_init and __res_nclose. [GLIBC_2.2] (libresolv): Add __dn_expand, __ns_samename, __res_mkquery, __res_nsend, __res_query, __res_querydomain and __res_search. * resolv/Banner: BIND-8.2.3-T5B. * resolv/base64.c: Update from BIND 8.2.3-T5B. * resolv/herror.c: Likewise. * resolv/inet_addr.c: Likewise. * resolv/inet_net_ntop.c: Likewise. * resolv/inet_net_pton.c: Likewise. * resolv/inet_neta.c: Likewise. * resolv/inet_ntop.c: Likewise. * resolv/nsap_addr.c: Likewise. * resolv/inet_pton.c: Likewise. Reject a few more more invalid IPv6 addresses (ISC bug #520). * resolv/ns_name.c: Avoid emitting RCS ID in object file. * resolv/ns_parse.c: Likewise. * resolv/ns_netint.c: Likewise. * resolv/ns_samedomain.c: Likewise. * resolv/ns_ttl.c: Likewise. * resolv/ns_print.c: Update from BIND 8.2.3-T5B. Avoid emitting RCS ID in object file. * resolv/res_debug.c: Update from BIND 8.2.3-T5B. * resolv/res_mkquery.c: Likewise. * resolv/res_query.c: Likewise. * resolv/res_init.c: Likewise. (res_setoptions): Mark internal. * resolv/res_send.c: Likewise. [_LIBC]: Fully reinstate the code that avoids the FD_SETSIZE limit by using poll instead. * resolv/res_comp.c: Likewise. [SHLIB_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_2)]: Make dn_expand a weak alias for __dn_expand. * resolv/res_data.c: Likewise. (res_close) [_LIBC]: Don't call res_nclose if RES_INIT isn't set in _res.options. Avoids a potential security risk by avoiding a close (0). [SHLIB_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_2)]: Make res_mkquery, res_query, res_querydomain adn res_search weak aliases for __res_mkquery, __res_query, __res_querydomain and __res_search. * resolv/res_libc.c: (_res): Don't initialize. Fix res_close instead to avoid close(0). (res_init): Always use the static resolver context. [SHLIB_COMPAT (libc, GLIBC_2.0, GLIBC_2_2)]: Make res_init a weak alias for __res_init. * resolv/resolv.h: Update from BIND 8.2.3-T5B. Move definition of RES_SET_H_ERRNO and accompanying comment to... * include/resolv.h: ... here. * resolv/arpa/namser.h: Update from BIND 8.2.3-T5B. * resolv/arpa/nameser_compat.h: Likewise.
1 parent 80ec499 commit e685e07

31 files changed

+1150
-1010
lines changed

ChangeLog

+62
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,65 @@
1+
2000-07-18 Mark Kettenis <[email protected]>
2+
3+
Update resolver code to BIND 8.2.3-T5B.
4+
5+
* resolv/Versions [GLIBC_2.2] (libc): Add __res_init and
6+
__res_nclose.
7+
[GLIBC_2.2] (libresolv): Add __dn_expand, __ns_samename,
8+
__res_mkquery, __res_nsend, __res_query, __res_querydomain and
9+
__res_search.
10+
* resolv/Banner: BIND-8.2.3-T5B.
11+
12+
* resolv/base64.c: Update from BIND 8.2.3-T5B.
13+
* resolv/herror.c: Likewise.
14+
* resolv/inet_addr.c: Likewise.
15+
* resolv/inet_net_ntop.c: Likewise.
16+
* resolv/inet_net_pton.c: Likewise.
17+
* resolv/inet_neta.c: Likewise.
18+
* resolv/inet_ntop.c: Likewise.
19+
* resolv/nsap_addr.c: Likewise.
20+
* resolv/inet_pton.c: Likewise. Reject a few more more invalid
21+
IPv6 addresses (ISC bug #520).
22+
23+
* resolv/ns_name.c: Avoid emitting RCS ID in object file.
24+
* resolv/ns_parse.c: Likewise.
25+
* resolv/ns_netint.c: Likewise.
26+
* resolv/ns_samedomain.c: Likewise.
27+
* resolv/ns_ttl.c: Likewise.
28+
* resolv/ns_print.c: Update from BIND 8.2.3-T5B. Avoid emitting
29+
RCS ID in object file.
30+
31+
* resolv/res_debug.c: Update from BIND 8.2.3-T5B.
32+
* resolv/res_mkquery.c: Likewise.
33+
* resolv/res_query.c: Likewise.
34+
* resolv/res_init.c: Likewise.
35+
(res_setoptions): Mark internal.
36+
* resolv/res_send.c: Likewise.
37+
[_LIBC]: Fully reinstate the code that avoids the FD_SETSIZE limit
38+
by using poll instead.
39+
* resolv/res_comp.c: Likewise.
40+
[SHLIB_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_2)]: Make dn_expand a
41+
weak alias for __dn_expand.
42+
* resolv/res_data.c: Likewise.
43+
(res_close) [_LIBC]: Don't call res_nclose if RES_INIT isn't set
44+
in _res.options. Avoids a potential security risk by avoiding a
45+
close (0).
46+
[SHLIB_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_2)]: Make
47+
res_mkquery, res_query, res_querydomain adn res_search weak
48+
aliases for __res_mkquery, __res_query, __res_querydomain and
49+
__res_search.
50+
* resolv/res_libc.c: (_res): Don't initialize. Fix res_close
51+
instead to avoid close(0).
52+
(res_init): Always use the static resolver context.
53+
[SHLIB_COMPAT (libc, GLIBC_2.0, GLIBC_2_2)]: Make res_init a weak
54+
alias for __res_init.
55+
56+
* resolv/resolv.h: Update from BIND 8.2.3-T5B. Move definition of
57+
RES_SET_H_ERRNO and accompanying comment to...
58+
* include/resolv.h: ... here.
59+
60+
* resolv/arpa/namser.h: Update from BIND 8.2.3-T5B.
61+
* resolv/arpa/nameser_compat.h: Likewise.
62+
163
2000-07-18 Ulrich Drepper <[email protected]>
264

365
* nss/makedb.c (main): Compare result of load_db with

include/resolv.h

+11
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1+
#ifndef _RESOLV_H_
2+
3+
#define RES_SET_H_ERRNO(r,x) \
4+
do \
5+
{ \
6+
(r)->res_h_errno = x; \
7+
__set_h_errno(x); \
8+
} \
9+
while (0)
10+
111
#include <resolv/resolv.h>
12+
#endif

linuxthreads/manager.c

-1
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,6 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
462462
new_thread->p_canceltype = PTHREAD_CANCEL_DEFERRED;
463463
new_thread->p_errnop = &new_thread->p_errno;
464464
new_thread->p_h_errnop = &new_thread->p_h_errno;
465-
new_thread->p_res._sock = -1;
466465
new_thread->p_resp = &new_thread->p_res;
467466
new_thread->p_guardaddr = guardaddr;
468467
new_thread->p_guardsize = guardsize;

resolv/Banner

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
BIND-8.2.2-5
1+
BIND-8.2.3-T5B

resolv/Versions

+6-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ libc {
2020
}
2121
GLIBC_2.2 {
2222
# r*
23-
__res_state; __res_ninit;
23+
__res_state; __res_init; __res_nclose; __res_ninit;
2424
}
2525
}
2626

@@ -51,8 +51,11 @@ libresolv {
5151
__ns_name_unpack; __ns_name_ntop;
5252
}
5353
GLIBC_2.2 {
54-
__res_nmkquery; __res_nquery; __res_nquerydomain; __res_nsearch;
55-
__ns_get16; __res_hostalias;
54+
__dn_expand;
55+
__ns_get16; __ns_samename;
56+
__res_hostalias; __res_mkquery; __res_nmkquery; __res_nquery;
57+
__res_nquerydomain; __res_nsearch; __res_nsend; __res_query;
58+
__res_querydomain; __res_search;
5659
}
5760

5861
libnss_dns {

resolv/arpa/nameser.h

+10-3
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,21 @@
4545
*/
4646

4747
/*
48-
* $Id$
48+
* $BINDId: nameser.h,v 8.37 2000/03/30 21:16:49 vixie Exp $
4949
*/
5050

5151
#ifndef _ARPA_NAMESER_H_
5252
#define _ARPA_NAMESER_H_
5353

5454
#define BIND_4_COMPAT
5555

56-
#include <features.h>
5756
#include <sys/param.h>
58-
#include <sys/types.h>
57+
#if (!defined(BSD)) || (BSD < 199306)
58+
# include <sys/bitypes.h>
59+
#else
60+
# include <sys/types.h>
61+
#endif
62+
#include <sys/cdefs.h>
5963

6064
/*
6165
* Revision information. This is the release date in YYYYMMDD format.
@@ -481,6 +485,7 @@ typedef enum __ns_cert_types {
481485
#define ns_name_compress __ns_name_compress
482486
#define ns_name_uncompress __ns_name_uncompress
483487
#define ns_name_skip __ns_name_skip
488+
#define ns_name_rollback __ns_name_rollback
484489
#define ns_sign __ns_sign
485490
#define ns_sign_tcp __ns_sign_tcp
486491
#define ns_sign_tcp_init __ns_sign_tcp_init
@@ -522,6 +527,8 @@ int ns_name_uncompress __P((const u_char *, const u_char *,
522527
int ns_name_compress __P((const char *, u_char *, size_t,
523528
const u_char **, const u_char **));
524529
int ns_name_skip __P((const u_char **, const u_char *));
530+
void ns_name_rollback __P((const u_char *, const u_char **,
531+
const u_char **));
525532
int ns_sign __P((u_char *, int *, int, int, void *,
526533
const u_char *, int, u_char *, int *, time_t));
527534
int ns_sign_tcp __P((u_char *, int *, int, int,

resolv/arpa/nameser_compat.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,14 @@
2828

2929
/*
3030
* from nameser.h 8.1 (Berkeley) 6/2/93
31-
* $Id$
31+
* $BINDId: nameser_compat.h,v 8.11 1999/01/02 08:00:58 vixie Exp $
3232
*/
3333

3434
#ifndef _ARPA_NAMESER_COMPAT_
3535
#define _ARPA_NAMESER_COMPAT_
3636

3737
#define __BIND 19950621 /* (DEAD) interface version stamp. */
3838

39-
/* glibc always has byte order info in <endian.h> */
4039
#include <endian.h>
4140

4241
/*

resolv/base64.c

+20-36
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996 by Internet Software Consortium.
2+
* Copyright (c) 1996-1999 by Internet Software Consortium.
33
*
44
* Permission to use, copy, modify, and distribute this software for any
55
* purpose with or without fee is hereby granted, provided that the above
@@ -40,23 +40,23 @@
4040
* IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
4141
*/
4242

43+
#if !defined(LINT) && !defined(CODECENTER)
44+
static const char rcsid[] = "$BINDId: base64.c,v 8.7 1999/10/13 16:39:33 vixie Exp $";
45+
#endif /* not lint */
46+
4347
#include <sys/types.h>
4448
#include <sys/param.h>
4549
#include <sys/socket.h>
50+
4651
#include <netinet/in.h>
4752
#include <arpa/inet.h>
4853
#include <arpa/nameser.h>
4954

5055
#include <ctype.h>
5156
#include <resolv.h>
5257
#include <stdio.h>
53-
54-
#if defined(BSD) && (BSD >= 199103) && defined(AF_INET6)
55-
# include <stdlib.h>
56-
# include <string.h>
57-
#else
58-
# include "../conf/portability.h"
59-
#endif
58+
#include <stdlib.h>
59+
#include <string.h>
6060

6161
#define Assert(Cond) if (!(Cond)) abort()
6262

@@ -112,9 +112,9 @@ static const char Pad64 = '=';
112112
end of the data is performed using the '=' character.
113113
114114
Since all base64 input is an integral number of octets, only the
115-
-------------------------------------------------
115+
-------------------------------------------------
116116
following cases can arise:
117-
117+
118118
(1) the final quantum of encoding input is an integral
119119
multiple of 24 bits; here, the final unit of encoded
120120
output will be an integral multiple of 4 characters
@@ -128,12 +128,7 @@ static const char Pad64 = '=';
128128
*/
129129

130130
int
131-
b64_ntop(src, srclength, target, targsize)
132-
u_char const *src;
133-
size_t srclength;
134-
char *target;
135-
size_t targsize;
136-
{
131+
b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize) {
137132
size_t datalength = 0;
138133
u_char input[3];
139134
u_char output[4];
@@ -161,14 +156,14 @@ b64_ntop(src, srclength, target, targsize)
161156
target[datalength++] = Base64[output[2]];
162157
target[datalength++] = Base64[output[3]];
163158
}
164-
159+
165160
/* Now we worry about padding. */
166161
if (0 != srclength) {
167162
/* Get what's left. */
168163
input[0] = input[1] = input[2] = '\0';
169164
for (i = 0; i < srclength; i++)
170165
input[i] = *src++;
171-
166+
172167
output[0] = input[0] >> 2;
173168
output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
174169
output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
@@ -204,8 +199,7 @@ b64_pton(src, target, targsize)
204199
u_char *target;
205200
size_t targsize;
206201
{
207-
size_t tarindex;
208-
int state, ch;
202+
int tarindex, state, ch;
209203
char *pos;
210204

211205
state = 0;
@@ -225,15 +219,15 @@ b64_pton(src, target, targsize)
225219
switch (state) {
226220
case 0:
227221
if (target) {
228-
if (tarindex >= targsize)
222+
if ((size_t)tarindex >= targsize)
229223
return (-1);
230224
target[tarindex] = (pos - Base64) << 2;
231225
}
232226
state = 1;
233227
break;
234228
case 1:
235229
if (target) {
236-
if (tarindex + 1 >= targsize)
230+
if ((size_t)tarindex + 1 >= targsize)
237231
return (-1);
238232
target[tarindex] |= (pos - Base64) >> 4;
239233
target[tarindex+1] = ((pos - Base64) & 0x0f)
@@ -244,7 +238,7 @@ b64_pton(src, target, targsize)
244238
break;
245239
case 2:
246240
if (target) {
247-
if (tarindex + 1 >= targsize)
241+
if ((size_t)tarindex + 1 >= targsize)
248242
return (-1);
249243
target[tarindex] |= (pos - Base64) >> 2;
250244
target[tarindex+1] = ((pos - Base64) & 0x03)
@@ -255,7 +249,7 @@ b64_pton(src, target, targsize)
255249
break;
256250
case 3:
257251
if (target) {
258-
if (tarindex >= targsize)
252+
if ((size_t)tarindex >= targsize)
259253
return (-1);
260254
target[tarindex] |= (pos - Base64);
261255
}
@@ -281,12 +275,7 @@ b64_pton(src, target, targsize)
281275

282276
case 2: /* Valid, means one byte of info */
283277
/* Skip any number of spaces. */
284-
#ifdef _LIBC
285-
/* To avoid warnings. */
286-
for ( ; ch != '\0'; ch = *src++)
287-
#else
288-
for (NULL; ch != '\0'; ch = *src++)
289-
#endif
278+
for ((void)NULL; ch != '\0'; ch = *src++)
290279
if (!isspace(ch))
291280
break;
292281
/* Make sure there is another trailing = sign. */
@@ -301,12 +290,7 @@ b64_pton(src, target, targsize)
301290
* We know this char is an =. Is there anything but
302291
* whitespace after it?
303292
*/
304-
#ifdef _LIBC
305-
/* To avoid warnings. */
306-
for ( ; ch != '\0'; ch = *src++)
307-
#else
308-
for (NULL; ch != '\0'; ch = *src++)
309-
#endif
293+
for ((void)NULL; ch != '\0'; ch = *src++)
310294
if (!isspace(ch))
311295
return (-1);
312296

0 commit comments

Comments
 (0)