Commit Graph

41 Commits

Author SHA1 Message Date
lukem
edf03256a8 Fix possible memory leak in error path.
Part of PR 38677.
2008-05-18 22:36:15 +00:00
lukem
2713f76747 Convert getnetbyname(3) and getnetbyaddr(3) to the more "standard"
nsdispatch() backend method API.
2008-05-08 13:01:42 +00:00
lukem
d8aac84366 Fix a misuse of an automatic as a static that was exposed by the previous. 2008-05-08 12:26:55 +00:00
lukem
6e5e2748b3 Fix DNS getnetbyname(), which has been broken for at least 5.5 years
(if not longer).
2008-05-08 05:06:18 +00:00
christos
efba316dcc Appropriate versions are not supplied by bind anymore. 2007-01-27 22:27:35 +00:00
christos
d73eb73dc8 merge in resolver portion of bind-9.4.0-rc2 2007-01-27 22:26:43 +00:00
christos
ce2c90c7c1 fix incomplete initializers 2006-10-15 16:14:46 +00:00
tsutsui
6a8419e3ee Change type of `net' variable passed via va_list in
_{files,dns,yp}_getenetbyaddr() functions from unsigned long to uint32_t.
In rev 1.29, getnetbyaddr(3) was changed to take uint32_t `net' argument
and also passisng uint32_t `net' to nsdispatch(3) varargs, but
these callback functions were not changed accordingly.

Patch was provided by christos, and this fixes amd(8) coredumps on alpha
when /etc/nsswitch.conf has more than one sources for netgroups.
2006-09-18 17:15:39 +00:00
ginsbach
f44127c4ef Fix Coverity issue 2281, resource leak, function return without freeing
dynamically allocated storage.
2006-03-17 15:53:29 +00:00
lukem
2f0fdfa7f7 Move the test for "more strict reverse lookup handling" to the correct
location so that an uninitialized `in' won't be used if net_i == BYADDR.
Detected with gcc -Wuninitialized, confirmed by diffing against BIND 4.9.11.
(The bug was introduced in rev 1.26.  Hi Itojun! :)
2005-06-01 05:19:21 +00:00
christos
13cc3543b5 centralize res_*init() calls in __res_get_state() 2004-05-23 16:54:12 +00:00
christos
d14c1915e0 Finish bind9 resolver merge. 2004-05-21 02:30:03 +00:00
kleink
8d54bc1847 struct netnet.n_net used to be an unsigned long integer.
In XNS5, and subsequently in POSIX-2001 it was changed to socklen_t.

To accomodate for this while preserving binary compatibility with the
old interface, prepend or append 32 bits of padding, depending on
the (LP64 data model) architecture's endianness.  Fixes PR
standards/21411 from Ben Harris.

This should be deleted the next time the libc major number is
incremented.

Also, update getnetbyaddr(3)'s `net' argument accordingly.
2004-05-08 18:52:15 +00:00
lukem
b763e0987d Use the correct parameters when building the YP map name in _yp_getnetbyaddr().
Fixes getnetbyaddr() when reading from YP.  From Brian Ginsbach in email.
2004-01-29 01:39:15 +00:00
agc
eb7c1594f1 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22280, verified by myself.
2003-08-07 16:42:00 +00:00
itojun
095b03757d pull in changes in http://www.isc.org/products/BIND/patches/bind4910.diff
- better error check on __dn_skipname
- more strict reverse lookup handling
2002-11-14 02:14:43 +00:00
itojun
d7ec2d5997 fix remote buffer overrun. from openbsd tree (1997). 2002-11-13 00:21:05 +00:00
itojun
62f36ff8e2 allocate 64K recieve buffer for DNS responses. 2002-08-27 08:50:49 +00:00
itojun
5c323232e7 eliminate sprintf, use snprintf. check strlcat error. 2002-08-16 11:30:28 +00:00
itojun
092b3bc66a avoid remote buffer overrun on hostbuf[]. From: Joost Pol <joost@pine.nl>
correct bad practice in the code - it uses two changing variables
to manage buffer (buf and buflen).  we eliminate buflen and use
fixed point (ep) as the ending pointer.

this fix is critical.
2002-06-26 06:00:07 +00:00
wiz
e3e4fede44 __STDC__ is always defined on NetBSD. 2002-05-26 14:48:19 +00:00
christos
663f790f35 remove redundant declarations. 2000-12-20 20:51:08 +00:00
mycroft
605490369c Delint.
Remove trailing ; from uses of __weak_alias().  The macro inserts this if
needed.
2000-01-22 22:19:07 +00:00
lukem
d896261208 back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
1999-09-20 04:38:56 +00:00
lukem
b48252f365 * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
  and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

		_DIAGASSERT(path != NULL)
	#ifdef _DIAGNOSTIC
		if (path == NULL) {
			errno = EFAULT;
			return (-1);
		}
	#endif
1999-09-16 11:44:54 +00:00
kleink
0b4eeeca95 Use a _files prefix for local backend routines; would clash with namespace.h
otherwise.
1999-05-04 15:11:42 +00:00
christos
8fe3352a10 sprinkle argsused till lint smiles at you. 1999-05-03 15:17:13 +00:00
lukem
257ec2e899 specifically include stdarg/varargs.h 1999-04-18 02:27:53 +00:00
christos
a45cc02ea7 add ARGSUSED 1999-01-20 13:09:04 +00:00
lukem
6b348d99e9 constify ns_dtab defs 1999-01-19 08:26:35 +00:00
lukem
0ae6c2e5b8 convert to new nsdispatch(3) 1999-01-19 08:01:48 +00:00
lukem
df91e2ba06 support nis lookups for getnetby*() 1999-01-19 04:10:23 +00:00
lukem
531c1c25e4 remove unused vars. remove register 1999-01-16 11:43:08 +00:00
lukem
2bf40fa435 pull nsswitch up to main branch
convert getnetby*() to nsswitch (from resolv.conf lookup)
1999-01-16 07:48:23 +00:00
pk
d92652f4ae Check the results of argument decomposition in octets to prevent
garbage being sent to name servers.
1998-12-05 13:17:55 +00:00
christos
2c89343c25 delint 1998-11-13 15:46:52 +00:00
perry
198f98faf0 $Id: -> Id: (to make hunting down other bad Ids easier). 1998-01-06 05:01:16 +00:00
mikel
e37bd19b9b sync __getnetbyaddr() prototypes with the one in getnetbyaddr.c; from
Krister Walfridsson in PR lib/4009
1997-08-19 05:02:49 +00:00
thorpej
c91bdb8141 - Add __weak_alias() namespace protection and update for changes to
getnetnyname.c and getnetbyaddr.c.
- Now that getnetbyname() and getnetbyaddr() support looking up their
  entries via BIND (they were previously file-only), add "lookup ..."
  dispatch support (in /etc/resolv.conf), a'la gethostby*().
1997-07-31 23:43:26 +00:00
mrg
38bfb6cd0a merge bind 4.9.6 resolver. still need to fix <resolv.h> 1997-07-20 13:33:17 +00:00
mrg
d507e9e46d bind 4.9.6 resolver files. 1997-07-20 04:07:42 +00:00