*** CHANGES	1996/11/11 06:36:40	8.48
--- CHANGES	1996/11/26 10:11:13	8.49
***************
*** 1,4 ****
--- 1,25 ----
  $Id$
  
+ 	--- 4.9.5-p1 released ---
+ 
+ 767. [port]	shres/sunos updates from the author.
+ 
+ 766. [bug]	nslookup was not limiting the number of addresses it handled.
+ 
+ 765. [port]	LOG_NOWAIT turned on if available.
+ 
+ 764. [lint]	nslookup NULL vs ERROR.
+ 
+ 763. [bug]	p_rr() was erroneously reporting short packets.
+ 
+ 762. [bug]	minor memory leak fixed (during bad-name syslogging).
+ 
+ 761. [port]	NeXTstep portability improved for modern systems.
+ 
+ 760. [bug]	NAPTR RR support was incomplete/broken in named-xfer.
+ 
+ 759. [port]	The resolver's POSIX.3 conformance is now optional since
+ 		it was causing trouble for vendor shared library editing.
+ 
  	--- 4.9.5-rel released ---
  
*** Makefile	1996/11/11 06:36:40	8.47
--- Makefile	1996/11/26 10:11:13	8.48
***************
*** 57,61 ****
  ## --Copyright--
  
! VER = 4.9.5-REL
  SHELL = /bin/sh
  MAKE = make
--- 57,61 ----
  ## --Copyright--
  
! VER = 4.9.5-P1
  SHELL = /bin/sh
  MAKE = make
*** conf/portability.h	1996/09/22 00:12:50	8.19
--- conf/portability.h	1996/11/26 10:11:16	8.20
***************
*** 153,156 ****
--- 153,158 ----
  # define NEED_PUTENV
  # define NEED_SETENV
+ # define HAVE_STDLIB_H
+ # define NEED_STRDUP
  # define inet_addr(a) __inet_addr(a)
  #endif
*** include/resolv.h	1996/09/28 06:51:03	8.16
--- include/resolv.h	1996/11/26 10:11:20	8.17
***************
*** 225,235 ****
  #define	dn_count_labels	__dn_count_labels
  #define	dn_comp		__dn_comp
- #define	dn_expand	__dn_expand
- #define	res_init	__res_init
  #define	res_randomid	__res_randomid
- #define	res_query	__res_query
- #define	res_search	__res_search
- #define	res_querydomain	__res_querydomain
- #define	res_mkquery	__res_mkquery
  #define	res_send	__res_send
  #define	res_isourserver	__res_isourserver
--- 225,229 ----
***************
*** 237,240 ****
--- 231,244 ----
  #define	res_queriesmatch __res_queriesmatch
  #define	res_close	__res_close
+ 
+ #ifdef BIND_RES_POSIX3
+ #define	dn_expand	__dn_expand
+ #define	res_init	__res_init
+ #define	res_query	__res_query
+ #define	res_search	__res_search
+ #define	res_querydomain	__res_querydomain
+ #define	res_mkquery	__res_mkquery
+ #endif
+ 
  __BEGIN_DECLS
  int		res_hnok __P((const char *));
*** named/named-xfer.c	1996/11/11 06:36:49	8.20
--- named/named-xfer.c	1996/11/26 10:11:22	8.21
***************
*** 1351,1356 ****
   
  		/* Replacement */
! 		n1 = (u_char *)data - cp1;
! 		n = dn_expand(msg, msg + msglen, cp, (char *)cp1, n1);
  		if (n < 0)
  			return (-1);
--- 1351,1356 ----
   
  		/* Replacement */
! 		n = dn_expand(msg, msg + msglen, cp, (char *)cp1,
! 			      sizeof data - (cp1 - data));
  		if (n < 0)
  			return (-1);
***************
*** 1722,1734 ****
  		/* Order */
  		GETSHORT(order, cp);
! 		fprintf(fp, "%lu", (u_long)order);
   
  		/* Preference */
  		GETSHORT(preference, cp);
! 		fprintf(fp, " %lu", (u_long)preference);
   
  		/* Flags */
  		if (n = *cp++) {
! 			fprintf(fp, " \"%.*s\"", (int)n, cp);
  			cp += n;
  		}
--- 1722,1734 ----
  		/* Order */
  		GETSHORT(order, cp);
! 		fprintf(dbfp, "%lu", (u_long)order);
   
  		/* Preference */
  		GETSHORT(preference, cp);
! 		fprintf(dbfp, " %lu", (u_long)preference);
   
  		/* Flags */
  		if (n = *cp++) {
! 			fprintf(dbfp, " \"%.*s\"", (int)n, cp);
  			cp += n;
  		}
***************
*** 1736,1740 ****
  		/* Service */
  		if (n = *cp++) {
! 			fprintf(fp, " \"%.*s\"", (int)n, cp);
  			cp += n;
  		}
--- 1736,1740 ----
  		/* Service */
  		if (n = *cp++) {
! 			fprintf(dbfp, " \"%.*s\"", (int)n, cp);
  			cp += n;
  		}
***************
*** 1742,1751 ****
  		/* Regexp */
  		if (n = *cp++) {
! 			fprintf(fp, " \"%.*s\"", (int)n, cp);
  			cp += n;
  		}
  
  		/* Replacement */
! 		fprintf(fp, " %s.\n", cp);
   
  		break;
--- 1742,1751 ----
  		/* Regexp */
  		if (n = *cp++) {
! 			fprintf(dbfp, " \"%.*s\"", (int)n, cp);
  			cp += n;
  		}
  
  		/* Replacement */
! 		fprintf(dbfp, " %s.\n", cp);
   
  		break;
*** named/ns_init.c	1996/11/11 06:36:49	8.22
--- named/ns_init.c	1996/11/26 10:11:22	8.23
***************
*** 1044,1047 ****
--- 1044,1049 ----
  		if (s)
  			free(s);
+ 		if (o)
+ 			free(o);
  	}
  	return (ok);
*** named/ns_main.c	1996/11/11 06:36:49	8.23
--- named/ns_main.c	1996/11/26 10:11:22	8.24
***************
*** 301,305 ****
  #if defined(DEBUG) && defined(LOG_PERROR)
  	if (debug)
! 		n = LOG_PERROR;
  #endif
  #ifdef LOG_DAEMON
--- 301,308 ----
  #if defined(DEBUG) && defined(LOG_PERROR)
  	if (debug)
! 		n |= LOG_PERROR;
! #endif
! #ifdef LOG_NOWAIT
! 	n |= LOG_NOWAIT;
  #endif
  #ifdef LOG_DAEMON
*** res/res_debug.c	1996/11/11 06:36:52	8.18
--- res/res_debug.c	1996/11/26 10:11:23	8.19
***************
*** 288,292 ****
  		return;
  
! #define TruncTest(x) if (x >= endMark) goto trunc
  #define	ErrorTest(x) if (x == NULL) goto error
  
--- 288,292 ----
  		return;
  
! #define TruncTest(x) if (x > endMark) goto trunc
  #define	ErrorTest(x) if (x == NULL) goto error
  
*** shres/sunos/INSTALL	1996/11/11 06:36:53	8.7
--- shres/sunos/INSTALL	1996/11/26 10:11:24	8.8
***************
*** 9,12 ****
--- 9,13 ----
    Paul Balyoz <pab@naucse.cse.nau.edu>
    Piete Brooks <pb@cl.cam.ac.uk>
+   Michael Helm <mike@fionn.lbl.gov>
    Dave Morrison <drmorris@mit.edu>
    Hal Pomeranz <pomeranz@nas.nasa.gov>
***************
*** 91,95 ****
        4.1.3:    100891-13
        4.1.3_U1: 101558-07
!       4.1.4:    102545-04
  
      Note that "international" means "has not installed the extra-cost 'US
--- 92,96 ----
        4.1.3:    100891-13
        4.1.3_U1: 101558-07
!       4.1.4:    102545-05
  
      Note that "international" means "has not installed the extra-cost 'US
***************
*** 121,124 ****
--- 122,129 ----
  manually instead.  (Please also let me know; I'll try to check for that
  problem, or at least document it in shres/sunos/PROBLEMS.)
+ 
+ If something goes wrong, remember that /bin/mv is statically linked; you
+ can use it to move the new (and broken) shared libraries out of the way,
+ then re-run ldconfig.
  
  Note that some or all of these steps may need to be done as root.  You
*** shres/sunos/ISSUES	1995/12/29 07:16:25	1.2
--- shres/sunos/ISSUES	1996/11/26 10:11:24	1.3
***************
*** 1,3 ****
! Issues with BIND 4.9.3 resolver code and SunOS 4.1.x shared libraries
  =====================================================================
  
--- 1,3 ----
! Issues with BIND 4.9.x resolver code and SunOS 4.1.x shared libraries
  =====================================================================
  
***************
*** 67,72 ****
  * Modifying the static libc
  
! The 4.9.3 libresolv uses an external routine (strerror) that is not in
! Sun's shipped libc.  The BIND 4.9.3 shared library install procedure
  merges the compatibility code for strerror into libc.so, but does not
  modify libc.a, nor does it include it into the unshareable libresolv.a.
--- 67,72 ----
  * Modifying the static libc
  
! The 4.9.x libresolv uses an external routine (strerror) that is not in
! Sun's shipped libc.  The BIND 4.9.x shared library install procedure
  merges the compatibility code for strerror into libc.so, but does not
  modify libc.a, nor does it include it into the unshareable libresolv.a.
***************
*** 74,78 ****
  that uses -lresolv will fail to link unless also linked with the
  compatibility library (lib44bsd.a).  Typical culprits are emacs and
! Berkeley sendmail 8.6.x, since they're among the few things that are often
  linked statically.
  
--- 74,78 ----
  that uses -lresolv will fail to link unless also linked with the
  compatibility library (lib44bsd.a).  Typical culprits are emacs and
! Berkeley sendmail 8.x, since they're among the few things that are often
  linked statically.
  
***************
*** 84,90 ****
  following:
  
!   - use 'ar' to integrate the needed compatibility code in libc.a
  
!   - use 'ar' to integrate the needed compatibility code in libresolv.a
  
    - always link programs dynamically, even when using -lresolv
--- 84,92 ----
  following:
  
!   - use 'ar' to put the needed compatibility code in libc.a
  
!   - use 'ar' to put the needed compatibility code in libresolv.a
! 
!   - use 'ar' to put the compatibility code in *both* libc and libresolv
  
    - always link programs dynamically, even when using -lresolv
***************
*** 99,102 ****
--- 101,112 ----
  it in libc in the first place.
  
+ Michael Helm pointed out, however, that there is a potential problem; if
+ code is linked with -lresolv and dynamically linked against a libc that
+ contains strerror, then moved to a machine that doesn't have strerror in
+ libc.so, it can fail (possibly silently, and often at the worst possible
+ time).  Accordingly, I now recommend putting the compatibility code into
+ libc.a (to protect against programs detecting it in libc.so and linking
+ with libc.a) and libresolv.a (to prevent the unresolved dependency issue).
+ 
  To do this, first make a copy of libc.a (call it libcnew.a).
  
***************
*** 117,120 ****
--- 127,139 ----
    mv libc.a libc.a.old && mv libcnew.a libc.a
  
+ Now, repeat the process with libresolv.a:
+ 
+   cd $BINDSRC/sun4.b
+   cp /usr/lib/libresolv.a /usr/lib/libresolvnew.a
+   ar rv /usr/lib/libresolvnew.a compat/lib/strerror.o
+   ranlib /usr/lib/libresolvnew.a
+   cd /usr/lib
+   mv libresolv.a libresolv.a.old && mv libresolvnew.a libresolv.a
+ 
  * RFC 1101 network names vs. /etc/networks
  
***************
*** 173,177 ****
  which were compiled with -lresolv before the shared library was installed
  has in it _res staticly compiled in as a global data structure.
! Unfortunately, the resolv library in 4.9.3 BIND has a global variable
  _res, and it is defined slightly differently.  At run time, when the
  shared libraries are loaded up, some linking is done by ld.so.  The
--- 192,196 ----
  which were compiled with -lresolv before the shared library was installed
  has in it _res staticly compiled in as a global data structure.
! Unfortunately, the resolv library in BIND 4.9.x has a global variable
  _res, and it is defined slightly differently.  At run time, when the
  shared libraries are loaded up, some linking is done by ld.so.  The
***************
*** 262,268 ****
  the option to upgrade the -lresolv code without major fuss.
  
! Update: in 4.9.3, the resolver library no longer uses initialized static
! data, so this should never be a problem again.  (You should still copy and
! re-ranlib the Sun-supplied libc.sa, however.)
  
  * shared library revision numbers
--- 281,287 ----
  the option to upgrade the -lresolv code without major fuss.
  
! Update: as of BIND 4.9.3, the resolver library no longer uses initialized
! static data, so this should never be a problem again.  (You should still
! copy and re-ranlib the Sun-supplied libc.sa, however.)
  
  * shared library revision numbers
***************
*** 294,302 ****
  to make read-only strings shared takes some nasty effort).
  
! Currently (4.9.3 resolv and gcc 2.5.8), the resolv library uses does not
! create any special gcc references.  Specifically, there are no unresolved
! references in the resolv objects, that are present in libgcc.a.  This
! means that even if you compile with gcc, the objects created may be linked
! with any compiler.  All is cool, use gcc.
  
  SHOULD THIS CHANGE (in a new release of gcc or BIND - not likely to
--- 313,322 ----
  to make read-only strings shared takes some nasty effort).
  
! Currently (BIND 4.9.3 or later resolver library and gcc 2.5.8 or later),
! the resolver library does not use any special gcc references.
! Specifically, there are no unresolved references in libresolv.a objects
! that are brought in from libgcc.a.  This means that even if you compile
! with gcc, the objects created may be linked with any compiler.  All is
! cool, use gcc.
  
  SHOULD THIS CHANGE (in a new release of gcc or BIND - not likely to
*** shres/sunos/PROBLEMS	1995/12/29 07:16:25	8.4
--- shres/sunos/PROBLEMS	1996/11/26 10:11:24	8.5
***************
*** 57,62 ****
  
  Solutions: Link with -l44bsd, link dynamically instead of statically, or
! include strerror.o in the non-shared libc as well (see shres/sunos/ISSUES,
! "Modifying the static libc").
  
  * "parse error" on inet.h, nameser.h, resolv.h, netdb.h, bitypes.h
--- 57,62 ----
  
  Solutions: Link with -l44bsd, link dynamically instead of statically, or
! include strerror.o in libresolv.a and/or the non-shared libc as well (see
! shres/sunos/ISSUES, "Modifying the static libc").
  
  * "parse error" on inet.h, nameser.h, resolv.h, netdb.h, bitypes.h
***************
*** 99,103 ****
  tries to use the (deprecated) INVQ operation to get the name of the DNS
  server it's talking to.  The inverse query stuff is not supported by
! default in BIND 4.9.3's named.
  
  Solutions:
--- 99,103 ----
  tries to use the (deprecated) INVQ operation to get the name of the DNS
  server it's talking to.  The inverse query stuff is not supported by
! default in BIND 4.9.x's named.
  
  Solutions:
***************
*** 112,117 ****
    (middlin') turn on "options fake-iquery" in your nameserver's named.boot
    file.  Unfortunately, this won't help you or your users if you point
!   nslookup toward an off-site 4.9.3 named that didn't do this.  See also
!   the BOG, section 5.1.11.
  
    (worst) compile with INVQ defined in conf/options.h.  This makes your
--- 112,117 ----
    (middlin') turn on "options fake-iquery" in your nameserver's named.boot
    file.  Unfortunately, this won't help you or your users if you point
!   nslookup toward an off-site 4.9.3 (or later version) named that didn't
!   do this.  See also the BOG, section 5.1.11.
  
    (worst) compile with INVQ defined in conf/options.h.  This makes your
***************
*** 130,142 ****
  * /etc/hosts or NIS not consulted for host lookups
  
! They aren't supposed to be; BIND 4.9.3's resolver is DNS-only.  4.9.4
! should have something similar to resolv+'s functionality (allowing you to
! configure the lookup order and services).  I leave /etc/hosts minimal (for
! use with mount and rcp, since they're statically linked) and don't run
! NIS.  At our site, DNS is considered the One True Hostname Authority.  NIS
! and /etc/hosts don't have the same semantics as DNS anyway, which can
! cause a number of problems.
! 
! Solutions: put all hosts in DNS, or use resolv+ until 4.9.4 is available.
  
  * mount and rcp don't look up hosts using DNS
--- 130,144 ----
  * /etc/hosts or NIS not consulted for host lookups
  
! They aren't supposed to be; BIND 4.9.x's resolver is DNS-only.  At some
! point, BIND should have something similar to resolv+'s functionality
! (allowing you to configure the lookup order and services).  I leave
! /etc/hosts minimal (for use with mount and rcp, since they're statically
! linked) and don't run NIS.  At our site, DNS is considered the One True
! Hostname Authority.  NIS and /etc/hosts don't have the same semantics as
! DNS anyway, which can cause a number of problems.
! 
! Solutions: put all hosts in DNS, or use resolv+ until BIND has this
! functionality.  (However, resolv+ is based on a VERY OLD version of BIND,
! with a number of security issues...so using it may not be practical.)
  
  * mount and rcp don't look up hosts using DNS
*** shres/sunos/makeshlib	1995/12/24 06:44:27	8.5
--- shres/sunos/makeshlib	1996/11/26 10:11:24	8.6
***************
*** 7,10 ****
--- 7,11 ----
  #               and Dave Morrison <drmorris@mit.edu>
  # with additions by Greg Woods <woods@planix.com>
+ #               and Michael Helm <mike@fionn.lbl.gov>
  #
  # $Id$
***************
*** 184,191 ****
  
  set -x
! cp libc.so.$VUCB /usr/lib
! cp libc.so.$VS5 /usr/5lib
! cp /usr/lib/libc.sa.$VUCB_OLD /usr/lib/libc.sa.$VUCB
! cp /usr/5lib/libc.sa.$VS5_OLD /usr/5lib/libc.sa.$VS5
  set +x
  
--- 185,192 ----
  
  set -x
! cp libc.so.$VUCB /usr/lib || exit 1
! cp libc.so.$VS5 /usr/5lib || exit 1
! cp /usr/lib/libc.sa.$VUCB_OLD /usr/lib/libc.sa.$VUCB || exit 1
! cp /usr/5lib/libc.sa.$VS5_OLD /usr/5lib/libc.sa.$VS5 || exit 1
  set +x
  
*** tools/nslookup/getinfo.c	1996/09/22 00:13:36	8.4
--- tools/nslookup/getinfo.c	1996/11/26 10:11:26	8.5
***************
*** 314,317 ****
--- 314,322 ----
  		    break;
  		}
+ 		if (numAddresses >= MAXADDRS) {
+ 			printf("MAXADDRS exceeded: skipping address\n");
+ 			cp += dlen;
+ 			continue;
+ 		}
  		bcopy(cp, *addrPtr++ = (char *)bp, dlen);
  		bp +=dlen;
*** tools/nslookup/list.c	1996/10/08 04:51:08	8.8
--- tools/nslookup/list.c	1996/11/26 10:11:26	8.9
***************
*** 778,782 ****
  		fprintf(file, "\t%u %u %u ", priority, weight, port);
  		if ((cp = (u_char *)Print_cdname(cp, msg, eom, file)) == NULL)
! 			return (NULL);
  		break;
  	    }
--- 778,782 ----
  		fprintf(file, "\t%u %u %u ", priority, weight, port);
  		if ((cp = (u_char *)Print_cdname(cp, msg, eom, file)) == NULL)
! 			return (ERROR);
  		break;
  	    }
***************
*** 804,808 ****
                  }
  		if ((cp = (u_char *)Print_cdname(cp, msg, eom, file)) == NULL)
! 			return (NULL);
                  break;
  	    }
--- 804,808 ----
                  }
  		if ((cp = (u_char *)Print_cdname(cp, msg, eom, file)) == NULL)
! 			return (ERROR);
                  break;
  	    }
