Add acc_rights detection (needs testing)

This commit is contained in:
Kurt Zeilenga 2003-03-02 21:46:40 +00:00
parent 206b071e7f
commit fe4f355328
6 changed files with 69 additions and 15 deletions

View File

@ -1216,3 +1216,16 @@ AC_DEFUN([OL_SASL_COMPAT],
#endif
], [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(msg_accrights in msghdr, ol_cv_msg_accrights,
[AC_TRY_COMPILE([#include <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_func_ctime_r_type = "int" ; then
AC_DEFINE(HAVE_MSGHDR_MSG_ACCRIGHTS,1,
[define if struct msghdr has msg_accrights])
fi
])dnl

60
configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh
# $OpenLDAP$
# from OpenLDAP: pkg/ldap/configure.in,v 1.460 2003/02/15 17:20:38 kurt Exp
# from OpenLDAP: pkg/ldap/configure.in,v 1.461 2003/03/02 20:21:39 kurt Exp
# Copyright 1998-2003 The OpenLDAP Foundation. All Rights Reserved.
#
@ -22952,6 +22952,40 @@ if test "$ac_cv_func_getopt" != yes; then
LIBSRCS="$LIBSRCS getopt.c"
fi
if test "$ac_cv_func_getpeereid" != yes; then
echo $ac_n "checking msg_accrights in msghdr""... $ac_c" 1>&6
echo "configure:22957: checking msg_accrights in msghdr" >&5
if eval "test \"\${ol_cv_msg_accrights+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 22962 "configure"
#include "confdefs.h"
#include <socket.h>
int main() {
struct msghdr m; m.msg_accrightslen=0
; return 0; }
EOF
if { (eval echo configure:22969: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ol_cv_msghdr_msg_accrights=yes
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
ol_cv_msghdr_msg_accrights=no
fi
rm -f conftest*
fi
echo "$ac_t""$ol_cv_msg_accrights" 1>&6
if test $ol_cv_func_ctime_r_type = "int" ; then
cat >> confdefs.h <<\EOF
#define HAVE_MSGHDR_MSG_ACCRIGHTS 1
EOF
fi
LIBSRCS="$LIBSRCS getpeereid.c"
fi
if test "$ac_cv_func_snprintf" != yes -o "$ac_cv_func_vsnprintf" != yes; then
@ -22971,13 +23005,13 @@ fi
# Check Configuration
echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
echo "configure:22975: checking declaration of sys_errlist" >&5
echo "configure:23009: checking declaration of sys_errlist" >&5
if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 22981 "configure"
#line 23015 "configure"
#include "confdefs.h"
#include <stdio.h>
@ -22990,7 +23024,7 @@ int main() {
char *c = (char *) *sys_errlist
; return 0; }
EOF
if { (eval echo configure:22994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:23028: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ol_cv_dcl_sys_errlist=yes
ol_cv_have_sys_errlist=yes
@ -23013,20 +23047,20 @@ EOF
echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
echo "configure:23017: checking existence of sys_errlist" >&5
echo "configure:23051: checking existence of sys_errlist" >&5
if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 23023 "configure"
#line 23057 "configure"
#include "confdefs.h"
#include <errno.h>
int main() {
char *c = (char *) *sys_errlist
; return 0; }
EOF
if { (eval echo configure:23030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:23064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ol_cv_have_sys_errlist=yes
else
@ -23054,17 +23088,17 @@ if test "$ol_enable_slapi" != no ; then
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:23058: checking for $ac_hdr" >&5
echo "configure:23092: checking for $ac_hdr" >&5
if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 23063 "configure"
#line 23097 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:23068: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:23102: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@ -23095,7 +23129,7 @@ done
{ echo "configure: error: could not locate <ltdl.h>" 1>&2; exit 1; }
fi
echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
echo "configure:23099: checking for lt_dlinit in -lltdl" >&5
echo "configure:23133: checking for lt_dlinit in -lltdl" >&5
ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -23103,7 +23137,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lltdl $LIBS"
cat > conftest.$ac_ext <<EOF
#line 23107 "configure"
#line 23141 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -23114,7 +23148,7 @@ int main() {
lt_dlinit()
; return 0; }
EOF
if { (eval echo configure:23118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:23152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else

View File

@ -2497,6 +2497,7 @@ if test "$ac_cv_func_getopt" != yes; then
LIBSRCS="$LIBSRCS getopt.c"
fi
if test "$ac_cv_func_getpeereid" != yes; then
OL_MSGHDR_MSG_ACCRIGHTS
LIBSRCS="$LIBSRCS getpeereid.c"
fi
if test "$ac_cv_func_snprintf" != yes -o "$ac_cv_func_vsnprintf" != yes; then

View File

@ -887,6 +887,9 @@
/* define to vsnprintf routine */
#undef vsnprintf
/* define if struct msghdr has msg_accrights */
#undef HAVE_MSGHDR_MSG_ACCRIGHTS
/* define to snprintf routine */
#undef snprintf

View File

@ -135,7 +135,9 @@ ldap_pvt_is_socket_ready(LDAP *ld, int s)
}
#undef TRACE
#if !defined(HAVE_GETPEEREID) && !defined(SO_PEERCRED) && !defined(LOCAL_PEERCRED) && defined(HAVE_SENDMSG)
#if !defined(HAVE_GETPEEREID) && \
!defined(SO_PEERCRED) && !defined(LOCAL_PEERCRED) && \
defined(HAVE_SENDMSG) && defined(HAVE_MSGHDR_MSG_ACCRIGHTS)
#define DO_SENDMSG
#endif

View File

@ -19,7 +19,8 @@
#include <sys/ucred.h>
#endif
#if !defined(SO_PEERCRED) && !defined(LOCAL_PEERCRED) && defined(HAVE_SENDMSG)
#if !defined(SO_PEERCRED) && !defined(LOCAL_PEERCRED) && \
defined(HAVE_SENDMSG) && defined(HAVE_MSGHDR_MSG_ACCRIGHTS)
#define DO_SENDMSG
#ifdef HAVE_SYS_UIO_H
#include <sys/uio.h>