], [ol_cv_sasl_compat=yes], [ol_cv_sasl_compat=no])])
])
dnl ====================================================================
-dnl check for msg_accrights in msghdr
-AC_DEFUN([OL_MSGHDR_MSG_ACCRIGHTS],
- [AC_CACHE_CHECK(for msg_accrights in msghdr, ol_cv_msghdr_msg_accrights,
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]],
- [[struct msghdr m; m.msg_accrightslen=0]])],
- [ol_cv_msghdr_msg_accrights=yes],
- [ol_cv_msghdr_msg_accrights=no])])
- if test $ol_cv_msghdr_msg_accrights = "yes" ; then
- AC_DEFINE(HAVE_MSGHDR_MSG_ACCRIGHTS,1,
- [define if struct msghdr has msg_accrights])
- fi
-])dnl
-dnl ====================================================================
-dnl check for cmsghdr
-AC_DEFUN([OL_MSGHDR_MSG_CONTROL],
- [AC_CACHE_CHECK(for msg_control in msghdr, ol_cv_msghdr_msg_control,
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]],
- [[struct msghdr m; m.msg_control=(struct cmsghdr *)0]])],
- [ol_cv_msghdr_msg_control=yes],
- [ol_cv_msghdr_msg_control=no])])
- if test $ol_cv_msghdr_msg_control = "yes" ; then
- AC_DEFINE(HAVE_MSGHDR_MSG_CONTROL,1,
- [define if struct msghdr has msg_control])
- fi
-])dnl
+dnl check for SSL compatibility
AC_DEFUN([OL_SSL_COMPAT],
[AC_CACHE_CHECK([OpenSSL library version (CRL checking capability)], [ol_cv_ssl_crl_compat],[
AC_EGREP_CPP(__ssl_compat,[
#! /bin/sh
-# From configure.in OpenLDAP: pkg/ldap/configure.in.
+# From configure.in OpenLDAP: pkg/ldap/configure.in,v 1.586.2.15 2005/08/12 22:48:41 kurt Exp .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59.
#
LIBSRCS="$LIBSRCS getopt.c"
fi
if test "$ac_cv_func_getpeereid" != yes; then
- echo "$as_me:$LINENO: checking for msg_accrights in msghdr" >&5
-echo $ECHO_N "checking for msg_accrights in msghdr... $ECHO_C" >&6
-if test "${ol_cv_msghdr_msg_accrights+set}" = set; then
+ echo "$as_me:$LINENO: checking for struct msghdr.msg_accrightslen" >&5
+echo $ECHO_N "checking for struct msghdr.msg_accrightslen... $ECHO_C" >&6
+if test "${ac_cv_member_struct_msghdr_msg_accrightslen+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+$ac_includes_default
+#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
+#endif
+
int
main ()
{
-struct msghdr m; m.msg_accrightslen=0
+static struct msghdr ac_aggr;
+if (ac_aggr.msg_accrightslen)
+return 0;
;
return 0;
}
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ol_cv_msghdr_msg_accrights=yes
+ ac_cv_member_struct_msghdr_msg_accrightslen=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ol_cv_msghdr_msg_accrights=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+int
+main ()
+{
+static struct msghdr ac_aggr;
+if (sizeof ac_aggr.msg_accrightslen)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_msghdr_msg_accrightslen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_member_struct_msghdr_msg_accrightslen=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $ol_cv_msghdr_msg_accrights" >&5
-echo "${ECHO_T}$ol_cv_msghdr_msg_accrights" >&6
- if test $ol_cv_msghdr_msg_accrights = "yes" ; then
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_msghdr_msg_accrightslen" >&5
+echo "${ECHO_T}$ac_cv_member_struct_msghdr_msg_accrightslen" >&6
+if test $ac_cv_member_struct_msghdr_msg_accrightslen = yes; then
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MSGHDR_MSG_ACCRIGHTS 1
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTSLEN 1
_ACEOF
- fi
- if test "$ac_cv_func_getpeereid" != yes; then
- echo "$as_me:$LINENO: checking for msg_control in msghdr" >&5
-echo $ECHO_N "checking for msg_control in msghdr... $ECHO_C" >&6
-if test "${ol_cv_msghdr_msg_control+set}" = set; then
+fi
+
+ if test "$ac_cv_member_struct_msghdr_msg_accrightslen" != yes; then
+ echo "$as_me:$LINENO: checking for struct msghdr.msg_control" >&5
+echo $ECHO_N "checking for struct msghdr.msg_control... $ECHO_C" >&6
+if test "${ac_cv_member_struct_msghdr_msg_control+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+$ac_includes_default
+#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
+#endif
+
int
main ()
{
-struct msghdr m; m.msg_control=(struct cmsghdr *)0
+static struct msghdr ac_aggr;
+if (ac_aggr.msg_control)
+return 0;
;
return 0;
}
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ol_cv_msghdr_msg_control=yes
+ ac_cv_member_struct_msghdr_msg_control=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ol_cv_msghdr_msg_control=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+int
+main ()
+{
+static struct msghdr ac_aggr;
+if (sizeof ac_aggr.msg_control)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_member_struct_msghdr_msg_control=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_member_struct_msghdr_msg_control=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $ol_cv_msghdr_msg_control" >&5
-echo "${ECHO_T}$ol_cv_msghdr_msg_control" >&6
- if test $ol_cv_msghdr_msg_control = "yes" ; then
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_msghdr_msg_control" >&5
+echo "${ECHO_T}$ac_cv_member_struct_msghdr_msg_control" >&6
+if test $ac_cv_member_struct_msghdr_msg_control = yes; then
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MSGHDR_MSG_CONTROL 1
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_MSGHDR_MSG_CONTROL 1
_ACEOF
- fi
+
+fi
fi
LIBSRCS="$LIBSRCS getpeereid.c"
#if !defined(HAVE_GETPEEREID) && \
!defined(SO_PEERCRED) && !defined(LOCAL_PEERCRED) && \
- defined(HAVE_SENDMSG) && (defined(HAVE_MSGHDR_MSG_ACCRIGHTS) || \
- defined(HAVE_MSGHDR_MSG_CONTROL))
+ defined(HAVE_SENDMSG) && (defined(HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS) || \
+ defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL))
#define DO_SENDMSG
static const char abandonPDU[] = {LDAP_TAG_MESSAGE, 6,
LDAP_TAG_MSGID, 1, 0, LDAP_REQ_ABANDON, 1, 0};
/* Abandon, noop, has no reply */
struct iovec iov;
struct msghdr msg = {0};
-# ifdef HAVE_MSGHDR_MSG_CONTROL
+# ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL
# ifndef CMSG_SPACE
# define CMSG_SPACE(len) (_CMSG_ALIGN( sizeof(struct cmsghdr)) + _CMSG_ALIGN(len) )
# endif
unsigned char control[CMSG_SPACE(sizeof(int))];
} control_un;
struct cmsghdr *cmsg;
-# endif /* HAVE_MSGHDR_MSG_CONTROL */
+# endif /* HAVE_STRUCT_MSGHDR_MSG_CONTROL */
msg.msg_name = NULL;
msg.msg_namelen = 0;
iov.iov_base = (char *) abandonPDU;
iov.iov_len = sizeof abandonPDU;
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
-# ifdef HAVE_MSGHDR_MSG_CONTROL
+# ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL
msg.msg_control = control_un.control;
msg.msg_controllen = sizeof( control_un.control );
msg.msg_flags = 0;
# else
msg.msg_accrights = (char *)fds;
msg.msg_accrightslen = sizeof(int);
-# endif /* HAVE_MSGHDR_MSG_CONTROL */
+# endif /* HAVE_STRUCT_MSGHDR_MSG_CONTROL */
sendmsg( s, &msg, 0 );
close(fds[0]);
close(fds[1]);
#endif
#if !defined(SO_PEERCRED) && !defined(LOCAL_PEERCRED) && \
- defined(HAVE_SENDMSG) && (defined(HAVE_MSGHDR_MSG_ACCRIGHTS) || \
- defined(HAVE_MSGHDR_MSG_CONTROL))
+ defined(HAVE_SENDMSG) && (defined(HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS) || \
+ defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL))
#define DO_SENDMSG
#ifdef HAVE_SYS_UIO_H
#include <sys/uio.h>
int err, fd[2];
struct iovec iov;
struct msghdr msg = {0};
-# ifdef HAVE_MSGHDR_MSG_CONTROL
+# ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL
# ifndef CMSG_SPACE
# define CMSG_SPACE(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + _CMSG_ALIGN(len))
# endif
unsigned char control[CMSG_SPACE(sizeof(int))];
} control_un;
struct cmsghdr *cmsg;
-# endif /* HAVE_MSGHDR_MSG_CONTROL */
+# endif /* HAVE_STRUCT_MSGHDR_MSG_CONTROL */
struct stat st;
msg.msg_name = NULL;
iov.iov_len = sizeof dummy;
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
-# ifdef HAVE_MSGHDR_MSG_CONTROL
+# ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL
msg.msg_control = control_un.control;
msg.msg_controllen = sizeof( control_un.control );
msg.msg_accrights = (char *)fd;
msg.msg_accrightslen = sizeof(fd);
if( recvmsg( s, &msg, MSG_PEEK) >= 0 && msg.msg_accrightslen == sizeof(int) )
-# endif /* HAVE_MSGHDR_MSG_CONTROL*/
+# endif /* HAVE_STRUCT_MSGHDR_MSG_CONTROL*/
{
/* We must receive a valid descriptor, it must be a pipe,
* and it must only be accessible by its owner.
*/
-# ifdef HAVE_MSGHDR_MSG_CONTROL
+# ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL
fd[0] = (*(int *)CMSG_DATA( cmsg ));
# endif
err = fstat( fd[0], &st );