Commit Graph

41 Commits

Author SHA1 Message Date
Hajimu UMEMOTO
ddb2984b5d query ip6.arpa then ip6.int for IPv6 reverse lookup. follows RFC3152.
MFC after:	5 days
2002-10-26 19:00:14 +00:00
Hajimu UMEMOTO
a52b6b83a2 Allocate 64K recieve buffer for DNS responses.
Though res_query.c also defines and refers MAXPACKET, it is not
related to ansbuf.  So, I didn't touch res_query.c.
2002-10-03 17:25:33 +00:00
Jacques Vidrine
54384cf3b0 Check for truncation in calls to res_send/res_query/res_search.
Fail when it is detected.
2002-09-15 16:51:09 +00:00
Jacques Vidrine
7deb8a7ddd Backout the increase of MAXPACKET from 1024 to 65536: it
broke pthreads.

Reported by:	mbr, tjr
2002-09-15 04:23:20 +00:00
Jacques Vidrine
2e4dbbaa93 When using res_send/res_query/res_search, the caller must either
insure enough space is available for the response, or be prepared
to resize the buffer and retry as necessary.

Do the conservative thing and make sure enough space is available.

Reviewed by:	silence on freebsd-audit
2002-09-13 20:31:29 +00:00
Warner Losh
145ec10619 Remove two stray lines that snuck in the cvs merge 2002-06-26 14:18:36 +00:00
Warner Losh
d6af58f572 Include more robust checking of end of buffer that more completely
plugs the hole.
2002-06-26 08:18:05 +00:00
Warner Losh
fda8311189 Fix a minor last, minute issue that came in after I committed.
Noticed by: nectar
2002-06-26 06:23:22 +00:00
Warner Losh
4cf0747073 Avoid remote buffer overflow on hostbuf[].
Submitted by: joost Pol <joost@pine.nl>
2002-06-26 06:04:46 +00:00
David E. O'Brien
333fc21e3c Fix the style of the SCM ID's.
I believe have made all of libc .c's as consistent as possible.
2002-03-22 21:53:29 +00:00
David E. O'Brien
c05ac53b8b Remove __P() usage. 2002-03-21 22:49:10 +00:00
David E. O'Brien
8fb3f3f682 Remove 'register' keyword. 2002-03-21 18:49:23 +00:00
Kris Kennaway
6dac8ac9e5 Mark some functions as __printflike() and/or taking const char * arguments
instead of char *.

MFC after:	2 weeks
2001-08-20 12:53:36 +00:00
Jacques Vidrine
248aee623c Add nsswitch support. By creating an /etc/nsswitch.conf file, you can
configure FreeBSD so that various databases such as passwd and group can be
looked up using flat files, NIS, or Hesiod.

= Hesiod has been added to libc (see hesiod(3)).

= A library routine for parsing nsswitch.conf and invoking callback
  functions as specified has been added to libc (see nsdispatch(3)).

= The following C library functions have been modified to use nsdispatch:
    . getgrent, getgrnam, getgrgid
    . getpwent, getpwnam, getpwuid
    . getusershell
    . getaddrinfo
    . gethostbyname, gethostbyname2, gethostbyaddr
    . getnetbyname, getnetbyaddr
    . getipnodebyname, getipnodebyaddr, getnodebyname, getnodebyaddr

= host.conf has been removed from src/etc.  rc.network has been modified
  to warn that host.conf is no longer used at boot time.  In addition, if
  there is a host.conf but no nsswitch.conf, the latter is created at boot
  time from the former.

Obtained from:	NetBSD
2000-09-06 18:16:48 +00:00
Bill Fenner
686d0736aa Fix coredump in gethostbyaddr() when the returned answer is too large to
fit in the static buffer.  This fix causes it to look like there is no
 data available, which is also wrong but is better than dumping core.

PR:		bin/10344
Reviewed by:	billf
Approved by:	jkh
2000-02-16 04:39:00 +00:00
Robert Watson
7ea38f3479 Suppress vast quantities of unneeded warnings spewed by libc's gethostbydns
on encountering a real-world SIG record during a lookup of another type.

PR:		bin/7352
Reviewed by:	peter, eivind
1999-12-28 07:21:08 +00:00
Andrey A. Chernov
fbc8d502c5 Add unsigned char cast to is[x]digit 1999-11-04 04:52:34 +00:00
Peter Wemm
7f3dea244c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
Peter Wemm
c8d2fd6da8 Update libc dns code to 4.9.7-T1B level. This involved chopping out large
chunks of res_comp.c and replacing it with chunks of bind-8.1.1's resolver
code.  (There are no interface changes though)
The other parts are better bounds checking related.
1998-05-02 13:11:02 +00:00
Peter Wemm
6c5aff806e Merge in bind-4.9.6 resolver changes. Note that they resolve the
overflow problem differently.
1997-06-27 08:22:03 +00:00
Peter Wemm
9547ea9f3a _res_close() -> res_close()
Pointed out by: bde
1997-03-12 11:02:00 +00:00
Peter Wemm
7e546392b5 Revert $FreeBSD$ to $Id$ 1997-02-22 15:12:41 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Andrey A. Chernov
07a7a2c487 Fix fake failures on the short names which looks like hexadecimal numbers
Submitted by: paul@vix.com
1997-01-08 13:06:14 +00:00
Andrey A. Chernov
64cf8d66e2 Disable isxdigit block until proper solution will be found
isxdigit(name[0]) gives false failures on short names which looks
like hexadecimal digits, f.e. "fade", "babe", "d133", etc.
1997-01-05 17:26:09 +00:00
Peter Wemm
ca785773f6 Here goes.. Bring the 4.9.5-P1 resolver into -current. This has the
DNSSEC stuff, among other things.  There are also some renamed functions,
I've left out the res_stubs.c from this commit in case cvs bombs out..
1996-12-30 13:18:48 +00:00
Bill Paul
3951b8e32c Small yet significant tweaks/cleanups:
- getservent:
  o put _yp_check() proto under #ifdef YP where it belongs
  o local YP buffers should be YPMAXRECORD + 2 bytes long and should
    be NUL terminated after copying

- gethostbynis:
  o local YP buffer should be YPMAXRECORD + 2 bytes long

- getnetbynis:
  o local YP buffer should be YPMAXRECORD + 2 bytes long and should
    be NUL terminated after copying

- ether_addr:
  o local YP buffers should be YPMAXRECORD + 2 bytes long and should
    be NUL terminated after copying (in this case it's BUFSIZ + 2 bytes,
    but it happens that BUFSIZ == YPMAXRECORD.

- gethostbydns:
  o nuke stray 'return(NULL)' in __dns_getanswer() (harmless but looks silly)

These are 2.2 candidates. I will wait a few days to make sure these don't
break anything and then, if there are no objections, move them to the 2.2
branch.
1996-12-27 18:21:07 +00:00
Bill Paul
6b73680dcf Make the __dns_getanswer() wrapper work right. For the newer versions
of BIND, we need to tweak some things to that gethostanswer() knows
whether or not we're dealing with an IPv4 or IPv6 address. (This'll
teach me to use a 2.1.0 system for NIS development -- but it's so nice
and stable I just can't being myself to upgrade it. :)
1996-12-24 02:10:24 +00:00
Bill Paul
ce8bac1e6d Add __dns_getanswer() hook to allow access to the gethostanswer()
functions from outside libc. (Needed for async DNS resolver in ypserv.)
1996-12-22 22:05:43 +00:00
Peter Wemm
df9c30afec Add an "officially undocumented" tweak for squid so that it can see the
TTL of DNS records that it looks up for it's resolver cache.

Obtained from: Endre Balint Nagy <bne@CareNet.hu>, via squid-1.1.x source.
1996-11-01 06:25:43 +00:00
Paul Traina
beddb20c7a Skip results that have unexpected lengths 1996-10-01 03:45:06 +00:00
Peter Wemm
5ce1c533c7 Merge in bind-4.9.4-P1 resolver... 1996-08-29 20:08:19 +00:00
Jordan K. Hubbard
51295a4d3e General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <graphix@iastate.edu>
1996-07-12 18:57:58 +00:00
Peter Wemm
4faad310d3 The last of the bind-4.9.3-REL resolver merges. 1996-01-13 09:03:58 +00:00
Poul-Henning Kamp
fce61be7f5 As above. 1995-10-22 14:39:06 +00:00
Bruce Evans
e6507d611f Fix bogus include paths, some of which stopped libresolv from compiling. 1995-08-21 09:15:40 +00:00
Peter Wemm
e5ad4f8712 Update the resolver part of libc to bind-4.9.3-beta24 level (from beta9p1)
Note that this was done by selective patching from diffs, to not conflict
with the 4.4bsd base code..  This was *not* a trivial task..  I have been
testing this code (apart from cosmetic changes) in my libc for a while now.

Obtained from: Paul Vixie <paul@vix.com>
1995-08-20 20:03:06 +00:00
Rodney W. Grimes
6c06b4e2aa Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
Garrett Wollman
40569757cc In _gethostbydnsaddr(), force RES_RECURSE into _res.options. This is
incredibly obnoxious, but also makes inverse mappings work when the local
resolver is in a cache-only configuration.  (Maybe this is actually
a bug in BIND?)
1994-12-01 22:25:38 +00:00
Paul Traina
8bdba3f880 remove need for -DDEBUG from resolver code (conflict with db/hash) 1994-09-25 17:45:41 +00:00
Paul Traina
1363f04ce1 get* rework and new bind code 1994-09-25 02:12:49 +00:00