mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-18 11:05:48 +08:00
Add new resolver checks
This commit is contained in:
parent
f1e2d35bd6
commit
3cba3840ac
@ -247,6 +247,75 @@ fi
|
||||
])
|
||||
dnl
|
||||
dnl ====================================================================
|
||||
dnl DNS resolver macros
|
||||
AC_DEFUN([OL_RESOLVER_TRY],
|
||||
[if test $ol_cv_lib_resolver = no ; then
|
||||
AC_CACHE_CHECK([for resolver link (]ifelse($2,,default,$2)[)],[$1],
|
||||
[
|
||||
ol_RESOLVER_LIB=ifelse($2,,,$2)
|
||||
ol_LIBS=$LIBS
|
||||
LIBS="$ol_RESOLVER_LIB $LIBS"
|
||||
|
||||
AC_TRY_LINK([
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#include <netinet/in.h>
|
||||
#ifdef HAVE_ARPA_NAMESER_H
|
||||
# include <arpa/nameser.h>
|
||||
#endif
|
||||
#ifdef HAVE_RESOLV_H
|
||||
# include <resolv.h>
|
||||
#endif
|
||||
],[{
|
||||
int len, status;
|
||||
char *request = NULL;
|
||||
unsigned char reply[64*1024];
|
||||
unsigned char host[64*1024];
|
||||
unsigned char *p;
|
||||
|
||||
#ifdef HS_HFIXEDSZ
|
||||
/* Bind 8/9 interface */
|
||||
len = res_query(request, ns_c_in, ns_t_srv, reply, sizeof(reply));
|
||||
#else
|
||||
/* Bind 4 interface */
|
||||
# ifndef T_SRV
|
||||
# define T_SRV 33
|
||||
# endif
|
||||
len = res_query(request, C_IN, T_SRV, reply, sizeof(reply));
|
||||
#endif
|
||||
p = reply;
|
||||
#ifdef HS_HFIXEDSZ
|
||||
/* Bind 8/9 interface */
|
||||
p += NS_HFIXEDSZ;
|
||||
#elif defined(HFIXEDSZ)
|
||||
/* Bind 4 interface w/ HFIXEDSZ */
|
||||
p += HFIXEDSZ;
|
||||
#else
|
||||
/* Bind 4 interface w/o HFIXEDSZ */
|
||||
p += sizeof(HEADER);
|
||||
#endif
|
||||
status = dn_expand( reply, reply+len, p, host, sizeof(host));
|
||||
}],[$1=yes],[$1=no])
|
||||
|
||||
LIBS="$ol_LIBS"
|
||||
])
|
||||
|
||||
if test $$1 = yes ; then
|
||||
ol_cv_lib_resolver=ifelse($2,,yes,$2)
|
||||
fi
|
||||
fi
|
||||
])
|
||||
dnl --------------------------------------------------------------------
|
||||
dnl Try to locate appropriate library
|
||||
AC_DEFUN([OL_RESOLVER_LINK],
|
||||
[ol_cv_lib_resolver=no
|
||||
OL_RESOLVER_TRY(ol_cv_resolver_none)
|
||||
OL_RESOLVER_TRY(ol_cv_resolver_resolv,[-lresol])
|
||||
OL_RESOLVER_TRY(ol_cv_resolver_bind,[-lbind])
|
||||
])
|
||||
dnl
|
||||
dnl ====================================================================
|
||||
dnl Berkeley DB macros
|
||||
dnl
|
||||
dnl --------------------------------------------------------------------
|
||||
|
49
configure.in
49
configure.in
@ -968,51 +968,26 @@ fi
|
||||
|
||||
dnl ----------------------------------------------------------------
|
||||
dnl Check for resolver routines
|
||||
dnl need to check for both res_query and __res_query
|
||||
dnl need to check -lc, -lbind, and -lresolv
|
||||
OL_RESOLVER_LINK
|
||||
|
||||
ol_link_dnssrv=no
|
||||
AC_CHECK_FUNC(res_query,:)
|
||||
if test $ac_cv_func_res_query = no ; then
|
||||
AC_CHECK_FUNC(__res_query,:)
|
||||
ac_cv_func_res_query=$ac_cv_func___res_query
|
||||
fi
|
||||
|
||||
if test $ac_cv_func_res_query = no ; then
|
||||
AC_CHECK_LIB(bind, res_query)
|
||||
ac_cv_func_res_query=$ac_cv_lib_bind_res_query
|
||||
fi
|
||||
|
||||
if test $ac_cv_func_res_query = no ; then
|
||||
AC_CHECK_LIB(bind, __res_query)
|
||||
ac_cv_func_res_query=$ac_cv_lib_bind___res_query
|
||||
fi
|
||||
|
||||
if test $ac_cv_func_res_query = no ; then
|
||||
AC_CHECK_LIB(resolv, res_query)
|
||||
ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
|
||||
fi
|
||||
|
||||
if test $ac_cv_func_res_query = no ; then
|
||||
AC_CHECK_LIB(resolv, __res_query)
|
||||
ac_cv_func_res_query=$ac_cv_lib_resolv___res_query
|
||||
fi
|
||||
|
||||
if test $ac_cv_func_res_query = no ; then
|
||||
AC_CHECK_LIB(resolv, _res_9_query)
|
||||
ac_cv_func_res_query=$ac_cv_lib_resolv_res_9_query
|
||||
fi
|
||||
|
||||
if test "$ac_cv_func_res_query" = yes ; then
|
||||
if test "$ol_cv_lib_resolver" != no ; then
|
||||
AC_DEFINE(HAVE_RES_QUERY,1,
|
||||
[define if you have res_query()])
|
||||
|
||||
if test $ol_enable_dnssrv != no ; then
|
||||
ol_link_dnssrv=yes
|
||||
if test "$ol_enable_dnssrv" != no ; then
|
||||
ol_link_dnssrv=yes;
|
||||
fi
|
||||
|
||||
if test "$ol_cv_lib_resolver" != yes ; then
|
||||
LIBS="$ol_cv_lib_resolver $LIBS"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$ol_enable_dnssrv" != no -a "$ol_link_dnssrv" = no ; then
|
||||
if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
|
||||
AC_MSG_ERROR([DNSSRV requires res_query()])
|
||||
else
|
||||
ol_enable_dnssrv=no
|
||||
fi
|
||||
|
||||
AC_CHECK_FUNCS( hstrerror )
|
||||
|
@ -221,13 +221,20 @@ typedef struct ldapcontrol {
|
||||
#define LDAP_CONTROL_PRE_READ "1.3.6.1.4.1.4203.666.5.10.1"
|
||||
#define LDAP_CONTROL_POST_READ "1.3.6.1.4.1.4203.666.5.10.2"
|
||||
|
||||
#if 0
|
||||
/* LDAP Duplicated Entry Control Extension *//* not implemented in slapd(8) */
|
||||
#define LDAP_CONTROL_DUPENT_REQUEST "2.16.840.1.113719.1.27.101.1"
|
||||
#define LDAP_CONTROL_DUPENT_RESPONSE "2.16.840.1.113719.1.27.101.2"
|
||||
#define LDAP_CONTROL_DUPENT_ENTRY "2.16.840.1.113719.1.27.101.3"
|
||||
#define LDAP_CONTROL_DUPENT LDAP_CONTROL_DUPENT_REQUEST
|
||||
#endif
|
||||
|
||||
/* LDAP Persistent Search Control *//* not implemented in slapd(8) */
|
||||
/* draft-ietf-ldapext-psearch-03.txt (expired) */
|
||||
#define LDAP_CONTROL_PERSIST_REQUEST "2.16.840.1.113730.3.4.3"
|
||||
#define LDAP_CONTROL_PERSIST_ENTRY_CHANGE_NOTICE "2.16.840.1.113730.3.4.7"
|
||||
#define LDAP_CONTROL_PERSSIT_ENTRY_CHANGE_ADD 0x1
|
||||
#define LDAP_CONTROL_PERSSIT_ENTRY_CHANGE_DELETE 0x2
|
||||
#define LDAP_CONTROL_PERSSIT_ENTRY_CHANGE_MODIFY 0x4
|
||||
#define LDAP_CONTROL_PERSSIT_ENTRY_CHANGE_RENAME 0x8
|
||||
|
||||
/* LDAP VLV *//* not implemented in slapd(8) */
|
||||
#define LDAP_CONTROL_VLVREQUEST "2.16.840.1.113730.3.4.9"
|
||||
|
@ -629,9 +629,6 @@
|
||||
/* Define if you have the V3 library (-lV3). */
|
||||
#undef HAVE_LIBV3
|
||||
|
||||
/* Define if you have the bind library (-lbind). */
|
||||
#undef HAVE_LIBBIND
|
||||
|
||||
/* Define if you have the gen library (-lgen). */
|
||||
#undef HAVE_LIBGEN
|
||||
|
||||
@ -647,9 +644,6 @@
|
||||
/* Define if you have the nsl_s library (-lnsl_s). */
|
||||
#undef HAVE_LIBNSL_S
|
||||
|
||||
/* Define if you have the resolv library (-lresolv). */
|
||||
#undef HAVE_LIBRESOLV
|
||||
|
||||
/* Define if you have the socket library (-lsocket). */
|
||||
#undef HAVE_LIBSOCKET
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user