Commit 41e16c59 authored by Mark Andrews's avatar Mark Andrews
Browse files

sync w/ bind8

parent 7a80d6d5
......@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: Makefile.in,v 1.25 2004/12/09 01:40:57 marka Exp $
# $Id: Makefile.in,v 1.26 2005/07/28 06:51:45 marka Exp $
srcdir = @srcdir@
VPATH = @srcdir@
......@@ -85,10 +85,11 @@ NAMESEROBJS= nameser/ns_date.@O@ nameser/ns_name.@O@ nameser/ns_netint.@O@ \
nameser/ns_parse.@O@ nameser/ns_print.@O@ nameser/ns_samedomain.@O@ \
nameser/ns_sign.@O@ nameser/ns_ttl.@O@ nameser/ns_verify.@O@
RESOLVOBJS= resolv/herror.@O@ resolv/res_comp.@O@ resolv/res_data.@O@ \
resolv/res_debug.@O@ resolv/res_findzonecut.@O@ resolv/res_init.@O@ \
resolv/res_mkquery.@O@ resolv/res_mkupdate.@O@ resolv/res_query.@O@ \
resolv/res_send.@O@ resolv/res_sendsigned.@O@ resolv/res_update.@O@
RESOLVOBJS= resolv/herror.@O@ resolv/mtctxres.@O@ resolv/res_comp.@O@ \
resolv/res_data.@O@ resolv/res_debug.@O@ resolv/res_findzonecut.@O@ \
resolv/res_init.@O@ resolv/res_mkquery.@O@ resolv/res_mkupdate.@O@ \
resolv/res_query.@O@ resolv/res_send.@O@ resolv/res_sendsigned.@O@ \
resolv/res_update.@O@
SUBDIRS = bsd dst include inet irs isc nameser resolv @PORT_INCLUDE@
......
#! /bin/sh
# From configure.in Revision: 1.107 .
# From configure.in Revision: 1.108 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59.
#
......@@ -464,7 +464,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
 
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA STD_CINCLUDES STD_CDEFINES STD_CWARNINGS CCOPT AR ARFLAGS LN ETAGS PERL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP ISC_PLATFORM_NEEDSYSSELECTH WANT_IRS_GR WANT_IRS_GR_OBJS WANT_IRS_PW WANT_IRS_PW_OBJS WANT_IRS_NIS WANT_IRS_NIS_OBJS WANT_IRS_NISGR_OBJS WANT_IRS_NISPW_OBJS WANT_IRS_DBPW_OBJS ALWAYS_DEFINES DO_PTHREADS WANT_IRS_THREADSGR_OBJS WANT_IRS_THREADSPW_OBJS WANT_IRS_THREADS_OBJS WANT_THREADS_OBJS USE_IFNAMELINKID ISC_THREAD_DIR DAEMON_OBJS NEED_DAEMON STRSEP_OBJS NEED_STRSEP NEED_STRERROR MKDEPCC MKDEPCFLAGS MKDEPPROG IRIX_DNSSEC_WARNINGS_HACK purify_path PURIFY LN_S ECHO ac_ct_AR STRIP ac_ct_STRIP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL O A SA LIBTOOL_MKDEP_SED LIBTOOL_MODE_COMPILE LIBTOOL_MODE_INSTALL LIBTOOL_MODE_LINK HAS_INET6_STRUCTS ISC_PLATFORM_NEEDNETINETIN6H ISC_PLATFORM_NEEDNETINET6IN6H HAS_IN_ADDR6 NEED_IN6ADDR_ANY ISC_PLATFORM_HAVEIN6PKTINFO ISC_PLATFORM_FIXIN6ISADDR ISC_IPV6_H ISC_IPV6_O ISC_ISCIPV6_O ISC_IPV6_C HAVE_SIN6_SCOPE_ID HAVE_SOCKADDR_STORAGE ISC_PLATFORM_NEEDNTOP ISC_PLATFORM_NEEDPTON ISC_PLATFORM_NEEDATON HAVE_SA_LEN HAVE_MINIMUM_IFREQ BSD_COMP SOLARIS_BITTYPES USE_FIONBIO_IOCTL PORT_NONBLOCK PORT_DIR PORT_INCLUDE ISC_PLATFORM_MSGHDRFLAVOR ISC_PLATFORM_NEEDPORTT ISC_LWRES_ENDHOSTENTINT ISC_LWRES_SETNETENTINT ISC_LWRES_ENDNETENTINT ISC_LWRES_GETHOSTBYADDRVOID ISC_LWRES_NEEDHERRNO ISC_LWRES_GETIPNODEPROTO ISC_LWRES_GETADDRINFOPROTO ISC_LWRES_GETNAMEINFOPROTO NEED_PSELECT NEED_GETTIMEOFDAY HAVE_STRNDUP ISC_PLATFORM_NEEDSTRSEP ISC_PLATFORM_NEEDVSNPRINTF ISC_EXTRA_OBJS ISC_EXTRA_SRCS USE_SYSERROR_LIST ISC_PLATFORM_QUADFORMAT ISC_SOCKLEN_T GETGROUPLIST_ARGS NET_R_ARGS NET_R_BAD NET_R_COPY NET_R_COPY_ARGS NET_R_OK NET_R_SETANSWER NET_R_RETURN GETNETBYADDR_ADDR_T NETENT_DATA NET_R_ENT_ARGS NET_R_SET_RESULT NET_R_SET_RETURN NET_R_END_RESULT NET_R_END_RETURN GROUP_R_ARGS GROUP_R_BAD GROUP_R_OK GROUP_R_RETURN GROUP_R_END_RESULT GROUP_R_END_RETURN GROUP_R_ENT_ARGS GROUP_R_SET_RESULT GROUP_R_SET_RETURN HOST_R_ARGS HOST_R_BAD HOST_R_COPY HOST_R_COPY_ARGS HOST_R_ERRNO HOST_R_OK HOST_R_RETURN HOST_R_SETANSWER HOSTENT_DATA HOST_R_END_RESULT HOST_R_END_RETURN HOST_R_ENT_ARGS HOST_R_SET_RESULT HOST_R_SET_RETURN SETPWENT_VOID SETGRENT_VOID NGR_R_ARGS NGR_R_BAD NGR_R_COPY NGR_R_COPY_ARGS NGR_R_OK NGR_R_RETURN NGR_R_PRIVATE NGR_R_END_RESULT NGR_R_END_RETURN NGR_R_ENT_ARGS NGR_R_SET_RESULT NGR_R_SET_RETURN PROTO_R_ARGS PROTO_R_BAD PROTO_R_COPY PROTO_R_COPY_ARGS PROTO_R_OK PROTO_R_SETANSWER PROTO_R_RETURN PROTO_R_END_RESULT PROTO_R_END_RETURN PROTO_R_ENT_ARGS PROTO_R_SET_RESULT PROTO_R_SET_RETURN PASS_R_ARGS PASS_R_BAD PASS_R_COPY PASS_R_COPY_ARGS PASS_R_OK PASS_R_RETURN PASS_R_END_RESULT PASS_R_END_RETURN PASS_R_ENT_ARGS PASS_R_SET_RESULT PASS_R_SET_RETURN SERV_R_ARGS SERV_R_BAD SERV_R_COPY SERV_R_COPY_ARGS SERV_R_OK SERV_R_SETANSWER SERV_R_RETURN SERV_R_END_RESULT SERV_R_END_RETURN SERV_R_ENT_ARGS SERV_R_SET_RESULT SERV_R_SET_RETURN SETNETGRENT_ARGS INNETGR_ARGS BIND9_TOP_BUILDDIR BIND9_VERSION LIBOBJS LTLIBOBJS'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA STD_CINCLUDES STD_CDEFINES STD_CWARNINGS CCOPT AR ARFLAGS LN ETAGS PERL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP ISC_PLATFORM_NEEDSYSSELECTH WANT_IRS_GR WANT_IRS_GR_OBJS WANT_IRS_PW WANT_IRS_PW_OBJS WANT_IRS_NIS WANT_IRS_NIS_OBJS WANT_IRS_NISGR_OBJS WANT_IRS_NISPW_OBJS WANT_IRS_DBPW_OBJS ALWAYS_DEFINES DO_PTHREADS WANT_IRS_THREADSGR_OBJS WANT_IRS_THREADSPW_OBJS WANT_IRS_THREADS_OBJS WANT_THREADS_OBJS USE_IFNAMELINKID ISC_THREAD_DIR DAEMON_OBJS NEED_DAEMON STRSEP_OBJS NEED_STRSEP NEED_STRERROR MKDEPCC MKDEPCFLAGS MKDEPPROG IRIX_DNSSEC_WARNINGS_HACK purify_path PURIFY LN_S ECHO ac_ct_AR STRIP ac_ct_STRIP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL O A SA LIBTOOL_MKDEP_SED LIBTOOL_MODE_COMPILE LIBTOOL_MODE_INSTALL LIBTOOL_MODE_LINK HAS_INET6_STRUCTS ISC_PLATFORM_NEEDNETINETIN6H ISC_PLATFORM_NEEDNETINET6IN6H HAS_IN_ADDR6 NEED_IN6ADDR_ANY ISC_PLATFORM_HAVEIN6PKTINFO ISC_PLATFORM_FIXIN6ISADDR ISC_IPV6_H ISC_IPV6_O ISC_ISCIPV6_O ISC_IPV6_C HAVE_SIN6_SCOPE_ID HAVE_SOCKADDR_STORAGE ISC_PLATFORM_NEEDNTOP ISC_PLATFORM_NEEDPTON ISC_PLATFORM_NEEDATON HAVE_SA_LEN HAVE_MINIMUM_IFREQ BSD_COMP SOLARIS_BITTYPES USE_FIONBIO_IOCTL PORT_NONBLOCK PORT_DIR USE_POLL HAVE_MD5 PORT_INCLUDE ISC_PLATFORM_MSGHDRFLAVOR ISC_PLATFORM_NEEDPORTT ISC_LWRES_ENDHOSTENTINT ISC_LWRES_SETNETENTINT ISC_LWRES_ENDNETENTINT ISC_LWRES_GETHOSTBYADDRVOID ISC_LWRES_NEEDHERRNO ISC_LWRES_GETIPNODEPROTO ISC_LWRES_GETADDRINFOPROTO ISC_LWRES_GETNAMEINFOPROTO NEED_PSELECT NEED_GETTIMEOFDAY HAVE_STRNDUP ISC_PLATFORM_NEEDSTRSEP ISC_PLATFORM_NEEDVSNPRINTF ISC_EXTRA_OBJS ISC_EXTRA_SRCS USE_SYSERROR_LIST ISC_PLATFORM_QUADFORMAT ISC_SOCKLEN_T GETGROUPLIST_ARGS NET_R_ARGS NET_R_BAD NET_R_COPY NET_R_COPY_ARGS NET_R_OK NET_R_SETANSWER NET_R_RETURN GETNETBYADDR_ADDR_T NETENT_DATA NET_R_ENT_ARGS NET_R_SET_RESULT NET_R_SET_RETURN NET_R_END_RESULT NET_R_END_RETURN GROUP_R_ARGS GROUP_R_BAD GROUP_R_OK GROUP_R_RETURN GROUP_R_END_RESULT GROUP_R_END_RETURN GROUP_R_ENT_ARGS GROUP_R_SET_RESULT GROUP_R_SET_RETURN HOST_R_ARGS HOST_R_BAD HOST_R_COPY HOST_R_COPY_ARGS HOST_R_ERRNO HOST_R_OK HOST_R_RETURN HOST_R_SETANSWER HOSTENT_DATA HOST_R_END_RESULT HOST_R_END_RETURN HOST_R_ENT_ARGS HOST_R_SET_RESULT HOST_R_SET_RETURN SETPWENT_VOID SETGRENT_VOID NGR_R_ARGS NGR_R_BAD NGR_R_COPY NGR_R_COPY_ARGS NGR_R_OK NGR_R_RETURN NGR_R_PRIVATE NGR_R_END_RESULT NGR_R_END_RETURN NGR_R_ENT_ARGS NGR_R_SET_RESULT NGR_R_SET_RETURN PROTO_R_ARGS PROTO_R_BAD PROTO_R_COPY PROTO_R_COPY_ARGS PROTO_R_OK PROTO_R_SETANSWER PROTO_R_RETURN PROTO_R_END_RESULT PROTO_R_END_RETURN PROTO_R_ENT_ARGS PROTO_R_SET_RESULT PROTO_R_SET_RETURN PASS_R_ARGS PASS_R_BAD PASS_R_COPY PASS_R_COPY_ARGS PASS_R_OK PASS_R_RETURN PASS_R_END_RESULT PASS_R_END_RETURN PASS_R_ENT_ARGS PASS_R_SET_RESULT PASS_R_SET_RETURN SERV_R_ARGS SERV_R_BAD SERV_R_COPY SERV_R_COPY_ARGS SERV_R_OK SERV_R_SETANSWER SERV_R_RETURN SERV_R_END_RESULT SERV_R_END_RETURN SERV_R_ENT_ARGS SERV_R_SET_RESULT SERV_R_SET_RETURN SETNETGRENT_ARGS INNETGR_ARGS BIND9_TOP_BUILDDIR BIND9_VERSION LIBOBJS LTLIBOBJS'
ac_subst_files='BIND9_INCLUDES BIND9_MAKE_RULES LIBBIND_API'
 
# Initialize some variables set by options.
......@@ -23151,6 +23151,8 @@ SOLARIS_BITTYPES="#undef NEED_SOLARIS_BITTYPES"
BSD_COMP="#undef BSD_COMP"
USE_FIONBIO_IOCTL="#undef USE_FIONBIO_IOCTL"
PORT_NONBLOCK="#define PORT_NONBLOCK O_NONBLOCK"
HAVE_MD5="#undef HAVE_MD5"
USE_POLL="#undef HAVE_POLL"
case "$host" in
*aix3.2*) PORT_DIR="port/aix32";;
*aix4*) PORT_DIR="port/aix4";;
......@@ -23188,7 +23190,12 @@ case "$host" in
BSD_COMP="#define BSD_COMP 1"
SOLARIS_BITTYPES="#define NEED_SOLARIS_BITTYPES 1"
PORT_DIR="port/solaris";;
*-solaris2.[67])
BSD_COMP="#define BSD_COMP 1"
PORT_DIR="port/solaris";;
*-solaris2*) BSD_COMP="#define BSD_COMP 1"
USE_POLL="#define USE_POLL 1"
HAVE_MD5="#define HAVE_MD5 1"
PORT_DIR="port/solaris";;
*-ultrix*) PORT_DIR="port/ultrix";;
*-sco-sysv*uw2.0*) PORT_DIR="port/unixware20";;
......@@ -23200,10 +23207,12 @@ esac
 
 
 
PORT_INCLUDE=${PORT_DIR}/include
 
 
 
PORT_INCLUDE=${PORT_DIR}/include
#
# Look for a 4.4BSD or 4.3BSD struct msghdr
#
......@@ -31455,6 +31464,8 @@ s,@SOLARIS_BITTYPES@,$SOLARIS_BITTYPES,;t t
s,@USE_FIONBIO_IOCTL@,$USE_FIONBIO_IOCTL,;t t
s,@PORT_NONBLOCK@,$PORT_NONBLOCK,;t t
s,@PORT_DIR@,$PORT_DIR,;t t
s,@USE_POLL@,$USE_POLL,;t t
s,@HAVE_MD5@,$HAVE_MD5,;t t
s,@PORT_INCLUDE@,$PORT_INCLUDE,;t t
s,@ISC_PLATFORM_MSGHDRFLAVOR@,$ISC_PLATFORM_MSGHDRFLAVOR,;t t
s,@ISC_PLATFORM_NEEDPORTT@,$ISC_PLATFORM_NEEDPORTT,;t t
......
......@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
AC_REVISION($Revision: 1.107 $)
AC_REVISION($Revision: 1.108 $)
AC_INIT(resolv/herror.c)
AC_PREREQ(2.13)
......@@ -998,6 +998,8 @@ SOLARIS_BITTYPES="#undef NEED_SOLARIS_BITTYPES"
BSD_COMP="#undef BSD_COMP"
USE_FIONBIO_IOCTL="#undef USE_FIONBIO_IOCTL"
PORT_NONBLOCK="#define PORT_NONBLOCK O_NONBLOCK"
HAVE_MD5="#undef HAVE_MD5"
USE_POLL="#undef HAVE_POLL"
case "$host" in
*aix3.2*) PORT_DIR="port/aix32";;
*aix4*) PORT_DIR="port/aix4";;
......@@ -1035,22 +1037,29 @@ case "$host" in
BSD_COMP="#define BSD_COMP 1"
SOLARIS_BITTYPES="#define NEED_SOLARIS_BITTYPES 1"
PORT_DIR="port/solaris";;
*-solaris2.[[67]])
BSD_COMP="#define BSD_COMP 1"
PORT_DIR="port/solaris";;
*-solaris2*) BSD_COMP="#define BSD_COMP 1"
USE_POLL="#define USE_POLL 1"
HAVE_MD5="#define HAVE_MD5 1"
PORT_DIR="port/solaris";;
*-ultrix*) PORT_DIR="port/ultrix";;
*-sco-sysv*uw2.0*) PORT_DIR="port/unixware20";;
*-sco-sysv*uw2.1.2*) PORT_DIR="port/unixware212";;
*-sco-sysv*uw7*) PORT_DIR="port/unixware7";;
esac
AC_SUBST(BSD_COMP)
AC_SUBST(SOLARIS_BITTYPES)
AC_SUBST(USE_FIONBIO_IOCTL)
AC_SUBST(PORT_NONBLOCK)
AC_SUBST(PORT_DIR)
AC_SUBST(USE_POLL)
AC_SUBST(HAVE_MD5)
PORT_INCLUDE=${PORT_DIR}/include
AC_SUBST(PORT_INCLUDE)
#
# Look for a 4.4BSD or 4.3BSD struct msghdr
#
......
#ifndef LINT
static const char rcsid[] = "$Header: /u0/home/explorer/proj/ISC/git-conversion/cvsroot/bind9/lib/bind/dst/Attic/dst_api.c,v 1.12 2005/04/27 04:56:13 sra Exp $";
static const char rcsid[] = "$Header: /u0/home/explorer/proj/ISC/git-conversion/cvsroot/bind9/lib/bind/dst/Attic/dst_api.c,v 1.13 2005/07/28 06:51:46 marka Exp $";
#endif
/*
......@@ -333,7 +333,10 @@ dst_read_key(const char *in_keyname, const u_int16_t in_id,
if (in_keyname == NULL) {
EREPORT(("dst_read_private_key(): Null key name passed in\n"));
return (NULL);
} else
} else if (strlen(in_keyname) >= sizeof(keyname)) {
EREPORT(("dst_read_private_key(): keyname too big\n"));
return (NULL);
} else
strcpy(keyname, in_keyname);
/* before I read in the public key, check if it is allowed to sign */
......@@ -344,7 +347,7 @@ dst_read_key(const char *in_keyname, const u_int16_t in_id,
return pubkey;
if (!(dg_key = dst_s_get_key_struct(keyname, pubkey->dk_alg,
pubkey->dk_flags, pubkey->dk_proto,
pubkey->dk_flags, pubkey->dk_proto,
0)))
return (dg_key);
/* Fill in private key and some fields in the general key structure */
......
#ifdef HMAC_MD5
#ifndef LINT
static const char rcsid[] = "$Header: /u0/home/explorer/proj/ISC/git-conversion/cvsroot/bind9/lib/bind/dst/Attic/hmac_link.c,v 1.4 2005/04/27 04:56:13 sra Exp $";
static const char rcsid[] = "$Header: /u0/home/explorer/proj/ISC/git-conversion/cvsroot/bind9/lib/bind/dst/Attic/hmac_link.c,v 1.5 2005/07/28 06:51:46 marka Exp $";
#endif
/*
* Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
......@@ -36,8 +36,15 @@ static const char rcsid[] = "$Header: /u0/home/explorer/proj/ISC/git-conversion/
#include <resolv.h>
#include "dst_internal.h"
#ifdef USE_MD5
# include "md5.h"
# ifndef HAVE_MD5
# include "md5.h"
# else
# ifdef SOLARIS2
# include <sys/md5.h>
# endif
# endif
# ifndef _MD5_H_
# define _MD5_H_ 1 /*%< make sure we do not include rsaref md5.h file */
# endif
......@@ -437,7 +444,11 @@ dst_hmac_md5_generate_key(DST_KEY *key, const int nothing)
* related functions
*/
int
#ifdef SUNW_LIBMD5
dst_md5_hmac_init()
#else
dst_hmac_md5_init()
#endif
{
if (dst_t_func[KEY_HMAC_MD5] != NULL)
return (1);
......
......@@ -59,6 +59,8 @@
#ifndef HEADER_MD5_H
#define HEADER_MD5_H
#ifndef HAVE_MD5
#ifdef __cplusplus
extern "C" {
#endif
......@@ -99,5 +101,8 @@ unsigned char *MD5();
#endif
#endif
#else
#include <sys/md5.h>
#endif /* HAVE_MD5 */
/*! \file */
......@@ -58,6 +58,7 @@
#ifdef USE_MD5 /*%< Added by ogud@tis.com 1998/1/26 */
#include <port_before.h>
#ifndef HAVE_MD5
#include <stdio.h>
#include "md5_locl.h"
#include <port_after.h>
......@@ -369,4 +370,5 @@ unsigned long *l;
}
}
#endif
#endif /* HAVE_MD5 */
#endif /* USE_MD5 */
static const char rcsid[] = "$Header: /u0/home/explorer/proj/ISC/git-conversion/cvsroot/bind9/lib/bind/dst/Attic/support.c,v 1.4 2005/04/27 04:56:14 sra Exp $";
static const char rcsid[] = "$Header: /u0/home/explorer/proj/ISC/git-conversion/cvsroot/bind9/lib/bind/dst/Attic/support.c,v 1.5 2005/07/28 06:51:47 marka Exp $";
/*
......@@ -305,19 +305,15 @@ dst_s_fopen(const char *filename, const char *mode, int perm)
{
FILE *fp;
char pathname[PATH_MAX];
size_t plen = sizeof(pathname);
if (strlen(filename) + strlen(dst_path) >= sizeof(pathname))
return (NULL);
if (*dst_path != '\0') {
strcpy(pathname, dst_path);
plen -= strlen(pathname);
}
else
pathname[0] = '\0';
if (plen > strlen(filename))
strncpy(&pathname[PATH_MAX - plen], filename, plen-1);
else
return (NULL);
strcat(pathname, filename);
} else
strcpy(pathname, filename);
fp = fopen(pathname, mode);
if (perm)
......
......@@ -18,7 +18,7 @@
/* eventlib.h - exported interfaces for eventlib
* vix 09sep95 [initial]
*
* $Id: eventlib.h,v 1.4 2005/04/27 04:56:17 sra Exp $
* $Id: eventlib.h,v 1.5 2005/07/28 06:51:47 marka Exp $
*/
#ifndef _EVENTLIB_H
......@@ -76,6 +76,8 @@ typedef struct { unsigned char mask[256/8]; } evByteMask;
#define EV_WRITE 2
#define EV_EXCEPT 4
#define EV_WASNONBLOCKING 8 /* Internal library use. */
/* eventlib.c */
#define evCreate __evCreate
#define evSetDebug __evSetDebug
......
#ifndef _RESOLV_MT_H
#define _RESOLV_MT_H
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
/* Access functions for the libresolv private interface */
int __res_enable_mt(void);
int __res_disable_mt(void);
/* Per-thread context */
typedef struct {
int no_hosts_fallback_private;
int retry_save;
int retry_private;
char inet_nsap_ntoa_tmpbuf[255*3];
char sym_ntos_unname[20];
char sym_ntop_unname[20];
char p_option_nbuf[40];
char p_time_nbuf[40];
char precsize_ntoa_retbuf[sizeof "90000000.00"];
char loc_ntoa_tmpbuf[sizeof
"1000 60 60.000 N 1000 60 60.000 W -12345678.00m 90000000.00m 90000000.00m 90000000.00m"];
char p_secstodate_output[15];
} mtctxres_t;
/* Thread-specific data (TSD) */
mtctxres_t *___mtctxres(void);
#define mtctxres (___mtctxres())
/* Various static data that should be TSD */
#define sym_ntos_unname (mtctxres->sym_ntos_unname)
#define sym_ntop_unname (mtctxres->sym_ntop_unname)
#define inet_nsap_ntoa_tmpbuf (mtctxres->inet_nsap_ntoa_tmpbuf)
#define p_option_nbuf (mtctxres->p_option_nbuf)
#define p_time_nbuf (mtctxres->p_time_nbuf)
#define precsize_ntoa_retbuf (mtctxres->precsize_ntoa_retbuf)
#define loc_ntoa_tmpbuf (mtctxres->loc_ntoa_tmpbuf)
#define p_secstodate_output (mtctxres->p_secstodate_output)
#endif /* _RESOLV_MT_H */
......@@ -16,7 +16,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static const char rcsid[] = "$Id: inet_pton.c,v 1.4 2005/04/27 04:56:21 sra Exp $";
static const char rcsid[] = "$Id: inet_pton.c,v 1.5 2005/07/28 06:51:47 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include "port_before.h"
......@@ -141,7 +141,7 @@ inet_pton6(src, dst)
xdigits_u[] = "0123456789ABCDEF";
u_char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
const char *xdigits, *curtok;
int ch, saw_xdigit;
int ch, seen_xdigits;
u_int val;
memset((tp = tmp), '\0', NS_IN6ADDRSZ);
......@@ -152,7 +152,7 @@ inet_pton6(src, dst)
if (*++src != ':')
return (0);
curtok = src;
saw_xdigit = 0;
seen_xdigits = 0;
val = 0;
while ((ch = *src++) != '\0') {
const char *pch;
......@@ -162,14 +162,13 @@ inet_pton6(src, dst)
if (pch != NULL) {
val <<= 4;
val |= (pch - xdigits);
if (val > 0xffff)
if (++seen_xdigits > 4)
return (0);
saw_xdigit = 1;
continue;
}
if (ch == ':') {
curtok = src;
if (!saw_xdigit) {
if (!seen_xdigits) {
if (colonp)
return (0);
colonp = tp;
......@@ -181,19 +180,19 @@ inet_pton6(src, dst)
return (0);
*tp++ = (u_char) (val >> 8) & 0xff;
*tp++ = (u_char) val & 0xff;
saw_xdigit = 0;
seen_xdigits = 0;
val = 0;
continue;
}
if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
inet_pton4(curtok, tp) > 0) {
tp += NS_INADDRSZ;
saw_xdigit = 0;
seen_xdigits = 0;
break; /*%< '\\0' was seen by inet_pton4(). */
}
return (0);
}
if (saw_xdigit) {
if (seen_xdigits) {
if (tp + NS_INT16SZ > endp)
return (0);
*tp++ = (u_char) (val >> 8) & 0xff;
......
......@@ -16,7 +16,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static const char rcsid[] = "$Id: nsap_addr.c,v 1.4 2005/04/27 04:56:21 sra Exp $";
static const char rcsid[] = "$Id: nsap_addr.c,v 1.5 2005/07/28 06:51:48 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include "port_before.h"
......@@ -31,6 +31,7 @@ static const char rcsid[] = "$Id: nsap_addr.c,v 1.4 2005/04/27 04:56:21 sra Exp
#include <ctype.h>
#include <resolv.h>
#include <resolv_mt.h>
#include "port_after.h"
......@@ -79,7 +80,7 @@ char *
inet_nsap_ntoa(int binlen, const u_char *binary, char *ascii) {
int nib;
int i;
static char tmpbuf[2+255*3];
char *tmpbuf = inet_nsap_ntoa_tmpbuf;
char *start;
if (ascii)
......
......@@ -248,6 +248,7 @@ do { \
goto free; \
} while (/*CONSTCOND*/0)
#ifndef SOLARIS2
#define ERR(err) \
do { \
/* external reference: error, and label bad */ \
......@@ -255,6 +256,16 @@ do { \
goto bad; \
/*NOTREACHED*/ \
} while (/*CONSTCOND*/0)
#else
#define ERR(err) \
do { \
/* external reference: error, and label bad */ \
error = (err); \
if (error == error) \
goto bad; \
} while (/*CONSTCOND*/0)
#endif
#define MATCH_FAMILY(x, y, w) \
((x) == (y) || (/*CONSTCOND*/(w) && ((x) == PF_UNSPEC || (y) == PF_UNSPEC)))
......@@ -325,6 +336,15 @@ getaddrinfo(hostname, servname, hints, res)
pai->ai_family = PF_UNSPEC;
pai->ai_socktype = ANY;
pai->ai_protocol = ANY;
#ifdef __sparcv9
/*
* clear _ai_pad to preserve binary
* compatibility with previously compiled 64-bit
* applications in a pre-SUSv3 environment by
* guaranteeing the upper 32-bits are empty.
*/
pai->_ai_pad = 0;
#endif /* __sparcv9 */
pai->ai_addrlen = 0;
pai->ai_canonname = NULL;
pai->ai_addr = NULL;
......@@ -349,6 +369,13 @@ getaddrinfo(hostname, servname, hints, res)
}
memcpy(pai, hints, sizeof(*pai));
#ifdef __sparcv9
/*
* We need to clear _ai_pad to preserve binary
* compatibility. See prior comment.
*/
pai->_ai_pad = 0;
#endif
/*
* if both socktype/protocol are specified, check if they
* are meaningful combination.
......
#if defined(LIBC_SCCS) && !defined(lint)
static const char rcsid[] = "$Id: hesiod.c,v 1.6 2005/04/27 04:56:27 sra Exp $";
static const char rcsid[] = "$Id: hesiod.c,v 1.7 2005/07/28 06:51:48 marka Exp $";
#endif
/*
......@@ -83,9 +83,7 @@ hesiod_init(void **context) {
return (-1);
}
ctx->LHS = NULL;
ctx->RHS = NULL;
ctx->res = NULL;
memset(ctx, 0, sizeof (*ctx));
if (parse_config_file(ctx, _PATH_HESIOD_CONF) < 0) {
#ifdef DEF_RHS
......
......@@ -20,7 +20,7 @@
*/
#if !defined(LINT) && !defined(CODECENTER)
static const char rcsid[] = "$Id: ev_files.c,v 1.7 2005/07/08 04:30:21 marka Exp $";
static const char rcsid[] = "$Id: ev_files.c,v 1.8 2005/07/28 06:51:48 marka Exp $";
#endif
#include "port_before.h"
......@@ -58,8 +58,10 @@ evSelectFD(evContext opaqueCtx,
ctx, fd, eventmask, func, uap);
if (eventmask == 0 || (eventmask & ~EV_MASK_ALL) != 0)
EV_ERR(EINVAL);
#ifndef USE_POLL
if (fd > ctx->highestFD)
EV_ERR(EINVAL);
#endif
OK(mode = fcntl(fd, F_GETFL, NULL)); /*%< side effect: validate fd. */
/*
* The first time we touch a file descriptor, we need to check to see
......@@ -67,6 +69,11 @@ evSelectFD(evContext opaqueCtx,
* of our deselect()'s have to leave it in O_NONBLOCK. If not, then
* all but our last deselect() has to leave it in O_NONBLOCK.
*/
#ifdef USE_POLL
/* Make sure both ctx->pollfds[] and ctx->fdTable[] are large enough */
if (fd >= ctx->maxnfds && evPollfdRealloc(ctx, 1, fd) != 0)
EV_ERR(ENOMEM);
#endif /* USE_POLL */
id = FindFD(ctx, fd, EV_MASK_ALL);
if (id == NULL) {
if (mode & PORT_NONBLOCK)
......@@ -142,13 +149,6 @@ evSelectFD(evContext opaqueCtx,
if (opaqueID)
opaqueID->opaque = id;
evPrintf(ctx, 5,
"evSelectFD(fd %d, mask 0x%x): new masks: 0x%lx 0x%lx 0x%lx\n",
fd, eventmask,
(u_long)ctx->rdNext.fds_bits[0],
(u_long)ctx->wrNext.fds_bits[0],
(u_long)ctx->exNext.fds_bits[0]);
return (0);
}
......@@ -258,13 +258,6 @@ evDeselectFD(evContext opaqueCtx, evFileID opaqueID) {
if (del == ctx->fdNext)
ctx->fdNext = del->next;
evPrintf(ctx, 5,
"evDeselectFD(fd %d, mask 0x%x): new masks: 0x%lx 0x%lx 0x%lx\n",
del->fd, eventmask,
(u_long)ctx->rdNext.fds_bits[0],
(u_long)ctx->wrNext.fds_bits[0],
(u_long)ctx->exNext.fds_bits[0]);
/* Couldn't free it before now since we were using fields out of it. */
FREE(del);
......
......@@ -20,7 +20,7 @@
*/
#if !defined(LINT) && !defined(CODECENTER)
static const char rcsid[] = "$Id: eventlib.c,v 1.8 2005/04/27 04:56:36 sra Exp $";
static const char rcsid[] = "$Id: eventlib.c,v 1.9 2005/07/28 06:51:49 marka Exp $";
#endif
#include "port_before.h"
......@@ -29,6 +29,9 @@ static const char rcsid[] = "$Id: eventlib.c,v 1.8 2005/04/27 04:56:36 sra Exp $
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
#ifdef SOLARIS2
#include <limits.h>
#endif /* SOLARIS2 */
#include <errno.h>
#include <signal.h>
......@@ -44,9 +47,13 @@ static const char rcsid[] = "$Id: eventlib.c,v 1.8 2005/04/27 04:56:36 sra Exp $
int __evOptMonoTime;
#ifdef USE_POLL
#define pselect Pselect
#endif /* USE_POLL */
/* Forward. */
#ifdef NEED_PSELECT
#if defined(NEED_PSELECT) || defined(USE_POLL)
static int pselect(int, void *, void *, void *,
struct timespec *,
const sigset_t *);
......@@ -79,6 +86,18 @@ evCreate(evContext *opaqueCtx) {
/* Files. */
ctx->files = NULL;
#ifdef USE_POLL
ctx->pollfds = NULL;
ctx->maxnfds = 0;
ctx->firstfd = 0;
emulMaskInit(ctx, rdLast, EV_READ, 1);
emulMaskInit(ctx, rdNext, EV_READ, 0);
emulMaskInit(ctx, wrLast, EV_WRITE, 1);
emulMaskInit(ctx, wrNext, EV_WRITE, 0);
emulMaskInit(ctx, exLast, EV_EXCEPT, 1);
emulMaskInit(ctx, exNext, EV_EXCEPT, 0);
emulMaskInit(ctx, nonblockBefore, EV_WASNONBLOCKING, 0);
#endif /* USE_POLL */
FD_ZERO(&ctx->rdNext);
FD_ZERO(&ctx->wrNext);
FD_ZERO(&ctx->exNext);
......@@ -86,11 +105,16 @@ evCreate(evContext *opaqueCtx) {
ctx->fdMax = -1;
ctx->fdNext = NULL;
ctx->fdCount = 0; /*%< Invalidate {rd,wr,ex}Last. */
#ifndef USE_POLL
ctx->highestFD = FD_SETSIZE - 1;
memset(ctx->fdTable, 0, sizeof ctx->fdTable);
#else
ctx->highestFD = INT_MAX / sizeof(struct pollfd);
ctx->fdTable = NULL;
#endif /* USE_POLL */
#ifdef EVENTLIB_TIME_CHECKS
ctx->lastFdCount = 0;
#endif
memset(ctx->fdTable, 0, sizeof ctx->fdTable);
/* Streams. */
ctx->streams = NULL;
......@@ -283,34 +307,37 @@ evGetNext(evContext opaqueCtx, evEvent *opaqueEv, int options) {
}
#endif
do {
/* XXX need to copy only the bits we are using. */
ctx->rdLast = ctx->rdNext;
ctx->wrLast = ctx->wrNext;
ctx->exLast = ctx->exNext;
#ifndef USE_POLL
/* XXX need to copy only the bits we are using. */
ctx->rdLast = ctx->rdNext;
ctx->wrLast = ctx->wrNext;