mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-27 18:19:52 -05:00
Add updated TCP wrapper check based upon patch provided
by Albert Chin-A-Young <china@thewrittenword.com> in ITS#1544.
This commit is contained in:
parent
ecdfc66a13
commit
5c7297a738
2 changed files with 263 additions and 258 deletions
52
configure.in
52
configure.in
|
|
@ -1958,32 +1958,46 @@ fi
|
||||||
|
|
||||||
dnl ----------------------------------------------------------------
|
dnl ----------------------------------------------------------------
|
||||||
if test $ol_enable_wrappers != no ; then
|
if test $ol_enable_wrappers != no ; then
|
||||||
AC_CHECK_HEADERS(tcpd.h)
|
AC_CHECK_HEADERS(tcpd.h,[
|
||||||
|
AC_MSG_CHECKING([for TCP wrappers library])
|
||||||
if test $ac_cv_header_tcpd_h != yes ; then
|
save_LIBS="$LIBS"
|
||||||
have_wrappers=no
|
LIBS="$LIBS -lwrap"
|
||||||
else
|
AC_TRY_LINK([
|
||||||
AC_TRY_COMPILE([
|
#include <tcpd.h>
|
||||||
int allow_severity = 0;
|
int allow_severity = 0;
|
||||||
int deny_severity = 0;
|
int deny_severity = 0;
|
||||||
],[hosts_access()],[have_wrappers=yes],[have_wrappers=no])
|
|
||||||
fi
|
struct request_info *req;
|
||||||
|
],[
|
||||||
|
hosts_access(req)
|
||||||
|
],[AC_MSG_RESULT([-lwrap])
|
||||||
|
have_wrappers=yes
|
||||||
|
LIBS="$save_LIBS"],[
|
||||||
|
dnl try with -lnsl
|
||||||
|
LIBS="$LIBS -lnsl"
|
||||||
|
AC_TRY_LINK([
|
||||||
|
#include <tcpd.h>
|
||||||
|
int allow_severity = 0;
|
||||||
|
int deny_severity = 0;
|
||||||
|
|
||||||
|
struct request_info *req;
|
||||||
|
],[
|
||||||
|
hosts_access(req)
|
||||||
|
],[AC_MSG_RESULT([-lwrap -lnsl])
|
||||||
|
have_wrappers=yes
|
||||||
|
LIBS="$save_LIBS -lnsl"],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
have_wrappers=no
|
||||||
|
LIBS=$save_LIBS])],[
|
||||||
|
have_wrappers=no])],[have_wrappers=no])
|
||||||
|
|
||||||
if test $have_wrappers = yes ; then
|
if test $have_wrappers = yes ; then
|
||||||
AC_DEFINE(HAVE_TCPD,1, [define if you have -lwrap])
|
AC_DEFINE(HAVE_TCPD,1, [define if you have -lwrap])
|
||||||
WRAP_LIBS="-lwrap"
|
WRAP_LIBS="-lwrap"
|
||||||
|
elif test $ol_enable_wrappers = yes ; then
|
||||||
dnl We add another check for -lnsl since some libwrap's
|
AC_MSG_ERROR([could not find TCP wrappers, select apppropriate options ore disable])
|
||||||
dnl need it, but it isn't always included from above
|
|
||||||
AC_CHECK_LIB(nsl, main)
|
|
||||||
else
|
else
|
||||||
AC_MSG_WARN(could not find -lwrap)
|
AC_MSG_WARN([could not find TCP wrappers, support disabled])
|
||||||
if test $ol_enable_wrappers = yes ; then
|
|
||||||
AC_MSG_ERROR(could not find wrappers, select appropriate options or disable)
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_MSG_WARN(disabling wrappers support)
|
|
||||||
ol_enable_wrappers=no
|
|
||||||
WRAP_LIBS=""
|
WRAP_LIBS=""
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue