From: Kurt Zeilenga Date: Sun, 16 Aug 1998 00:25:50 +0000 (+0000) Subject: Merge changes from LDAP_3_3+prerelease into BOOLEAN_LDAP X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abe659db1763667998f98d66999a3746c5f67e1a;p=thirdparty%2Fopenldap.git Merge changes from LDAP_3_3+prerelease into BOOLEAN_LDAP --- diff --git a/build/platforms/freebsd-gcc/Make-platform b/build/platforms/freebsd-gcc/Make-platform index 1d78ed72c2..1b8dae7517 100644 --- a/build/platforms/freebsd-gcc/Make-platform +++ b/build/platforms/freebsd-gcc/Make-platform @@ -15,5 +15,3 @@ CC = cc PLATFORMCFLAGS= -Dfreebsd -# uncomment this line if using for LDAP_CRYPT -#PLATFORMLIBS= -lcrypt diff --git a/build/platforms/linux-gcc/Make-platform b/build/platforms/linux-gcc/Make-platform index 5e2a39fc44..2699aac6f1 100644 --- a/build/platforms/linux-gcc/Make-platform +++ b/build/platforms/linux-gcc/Make-platform @@ -16,5 +16,3 @@ RANLIB = "ranlib" PLATFORMCFLAGS= -Dlinux -# uncomment this if -DLDAP_CRYPT is defined -#PLATFORMLIBS= -lcrypt diff --git a/configure b/configure index 1bf8c4f447..0ca16994fa 100755 --- a/configure +++ b/configure @@ -2071,6 +2071,7 @@ EOF fi for ac_hdr in \ + stddef.h \ fcntl.h \ limits.h \ malloc.h \ @@ -2085,17 +2086,17 @@ for ac_hdr in \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2089: checking for $ac_hdr" >&5 +echo "configure:2090: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2099: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2100: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2123,12 +2124,12 @@ done echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:2127: checking for uid_t in sys/types.h" >&5 +echo "configure:2128: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -2157,7 +2158,7 @@ EOF fi echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6 -echo "configure:2161: checking type of array argument to getgroups" >&5 +echo "configure:2162: checking type of array argument to getgroups" >&5 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2165,7 +2166,7 @@ else ac_cv_type_getgroups=cross else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_type_getgroups=gid_t else @@ -2204,7 +2205,7 @@ fi if test $ac_cv_type_getgroups = cross; then cat > conftest.$ac_ext < EOF @@ -2228,12 +2229,12 @@ EOF echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:2232: checking for mode_t" >&5 +echo "configure:2233: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2261,12 +2262,12 @@ EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2265: checking for off_t" >&5 +echo "configure:2266: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2294,12 +2295,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:2298: checking for pid_t" >&5 +echo "configure:2299: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2327,12 +2328,12 @@ EOF fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:2331: checking return type of signal handlers" >&5 +echo "configure:2332: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2349,7 +2350,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:2353: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2354: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -2368,12 +2369,12 @@ EOF echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2372: checking for size_t" >&5 +echo "configure:2373: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2401,12 +2402,12 @@ EOF fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:2405: checking for uid_t in sys/types.h" >&5 +echo "configure:2406: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -2435,12 +2436,12 @@ EOF fi echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 -echo "configure:2439: checking for st_blksize in struct stat" >&5 +echo "configure:2440: checking for st_blksize in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2448,7 +2449,7 @@ int main() { struct stat s; s.st_blksize; ; return 0; } EOF -if { (eval echo configure:2452: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2453: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blksize=yes else @@ -2469,12 +2470,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:2473: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:2474: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2483,7 +2484,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:2487: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2488: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -2504,12 +2505,12 @@ EOF fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:2508: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:2509: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2517,7 +2518,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:2521: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2522: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -2539,12 +2540,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2543: checking for working const" >&5 +echo "configure:2544: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2598: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2615,7 +2616,7 @@ fi echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:2619: checking for 8-bit clean memcmp" >&5 +echo "configure:2620: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2623,7 +2624,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else @@ -2651,12 +2652,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o" echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:2655: checking return type of signal handlers" >&5 +echo "configure:2656: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2673,7 +2674,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:2677: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2678: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -2692,12 +2693,12 @@ EOF echo $ac_n "checking for strftime""... $ac_c" 1>&6 -echo "configure:2696: checking for strftime" >&5 +echo "configure:2697: checking for strftime" >&5 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_strftime=yes" else @@ -2742,7 +2743,7 @@ else echo "$ac_t""no" 1>&6 # strftime is in -lintl on SCO UNIX. echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6 -echo "configure:2746: checking for strftime in -lintl" >&5 +echo "configure:2747: checking for strftime in -lintl" >&5 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2750,7 +2751,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2788,12 +2789,12 @@ fi fi echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:2792: checking for vprintf" >&5 +echo "configure:2793: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -2840,12 +2841,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:2844: checking for _doprnt" >&5 +echo "configure:2845: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -2893,7 +2894,7 @@ fi fi echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6 -echo "configure:2897: checking for wait3 that fills in rusage" >&5 +echo "configure:2898: checking for wait3 that fills in rusage" >&5 if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2901,7 +2902,7 @@ else ac_cv_func_wait3_rusage=no else cat > conftest.$ac_ext < #include @@ -2932,7 +2933,7 @@ main() { } } EOF -if { (eval echo configure:2936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_wait3_rusage=yes else @@ -2972,12 +2973,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2976: checking for $ac_func" >&5 +echo "configure:2977: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3028,12 +3029,12 @@ done for ac_func in strdup do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3032: checking for $ac_func" >&5 +echo "configure:3033: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3086,13 +3087,13 @@ done # Check Configuration echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6 -echo "configure:3090: checking declaration of sys_errlist" >&5 +echo "configure:3091: checking declaration of sys_errlist" >&5 if eval "test \"`echo '$''{'cf_cv_dcl_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -3102,7 +3103,7 @@ int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:3106: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3107: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cf_cv_dcl_sys_errlist=yes else @@ -3123,20 +3124,20 @@ if test $cf_cv_dcl_sys_errlist = no ; then EOF echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6 -echo "configure:3127: checking existence of sys_errlist" >&5 +echo "configure:3128: checking existence of sys_errlist" >&5 if eval "test \"`echo '$''{'cf_cv_have_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:3140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cf_cv_have_sys_errlist=yes else diff --git a/configure.in b/configure.in index ff3cf94d08..1e84b4974e 100644 --- a/configure.in +++ b/configure.in @@ -225,6 +225,7 @@ AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS( \ + stddef.h \ fcntl.h \ limits.h \ malloc.h \ diff --git a/include/lthread.h b/include/lthread.h index d712a5e593..d3fd3d0ec6 100644 --- a/include/lthread.h +++ b/include/lthread.h @@ -99,9 +99,11 @@ typedef void *(*VFP)(); /* sunos5 threads are preemptive */ #define PTHREAD_PREEMPTIVE 1 +#if !defined(__SunOS_5_6) /* thread attributes and thread type */ typedef int pthread_attr_t; typedef thread_t pthread_t; +#endif /* ! sunos56 */ /* default attr states */ #define pthread_mutexattr_default NULL @@ -114,17 +116,21 @@ typedef thread_t pthread_t; #define PTHREAD_SCOPE_PROCESS 0 #define PTHREAD_SCOPE_SYSTEM THR_BOUND +#if !defined(__SunOS_5_6) /* mutex attributes and mutex type */ typedef int pthread_mutexattr_t; typedef mutex_t pthread_mutex_t; +#endif /* ! sunos56 */ /* mutex and condition variable scope - process or system */ #define PTHREAD_SHARE_PRIVATE USYNC_THREAD #define PTHREAD_SHARE_PROCESS USYNC_PROCESS +#if !defined(__SunOS_5_6) /* condition variable attributes and condition variable type */ typedef int pthread_condattr_t; typedef cond_t pthread_cond_t; +#endif /* ! sunos56 */ #else /* end sunos5 */ diff --git a/include/portable.h.bot b/include/portable.h.bot index d60d10b32f..762c289cc6 100644 --- a/include/portable.h.bot +++ b/include/portable.h.bot @@ -1,2 +1,6 @@ +#ifdef HAVE_STDDEF_H +# include +#endif + #endif /* _LDAP_PORTABLE_H */ diff --git a/include/portable.h.in b/include/portable.h.in index 03c7c7508d..6a0fa84867 100644 --- a/include/portable.h.in +++ b/include/portable.h.in @@ -166,6 +166,9 @@ /* Define if you have the header file. */ #undef HAVE_SGTTY_H +/* Define if you have the header file. */ +#undef HAVE_STDDEF_H + /* Define if you have the header file. */ #undef HAVE_SYS_DIR_H @@ -193,4 +196,8 @@ /* Define if you have the compat library (-lcompat). */ #undef HAVE_LIBCOMPAT +#ifdef HAVE_STDDEF_H +# include +#endif + #endif /* _LDAP_PORTABLE_H */ diff --git a/libraries/liblber/encode.c b/libraries/liblber/encode.c index 0090cab852..cb9e30ffa0 100644 --- a/libraries/liblber/encode.c +++ b/libraries/liblber/encode.c @@ -24,7 +24,7 @@ #include #endif #endif /* next || vms */ -#if defined( BC31 ) || defined( _WIN32 ) || defined( sunos5 ) +#if defined( BC31 ) || defined( _WIN32 ) #include #else /* BC31 || _WIN32 */ #include @@ -522,7 +522,7 @@ ber_put_set( BerElement *ber ) /* VARARGS */ int ber_printf( -#if defined( MACOS ) || defined( _WIN32 ) || defined( BC31 ) || defined( sunos5 ) +#if defined( MACOS ) || defined( _WIN32 ) || defined( BC31 ) BerElement *ber, char *fmt, ... ) #else /* MACOS || _WIN32 || BC31 */ va_alist ) @@ -530,22 +530,22 @@ va_dcl #endif /* MACOS || _WIN32 || BC31 */ { va_list ap; -#if !defined( MACOS ) && !defined( _WIN32 ) && !defined( BC31 ) && !defined( sunos5 ) +#if !defined( MACOS ) && !defined( _WIN32 ) && !defined( BC31 ) BerElement *ber; char *fmt; -#endif /* !MACOS && !_WIN32 && !BC31 && !sunos5 */ +#endif /* !MACOS && !_WIN32 && !BC31 */ char *s, **ss; struct berval **bv; int rc, i; unsigned long len; -#if defined( MACOS ) || defined( _WIN32 ) || defined( BC31 ) || defined( sunos5 ) +#if defined( MACOS ) || defined( _WIN32 ) || defined( BC31 ) va_start( ap, fmt ); -#else /* MACOS || _WIN32 || BC31 || defined( sunos5 ) */ +#else /* MACOS || _WIN32 || BC31 */ va_start( ap ); ber = va_arg( ap, BerElement * ); fmt = va_arg( ap, char * ); -#endif /* MACOS || _WIN32 || BC31 || defined( sunos5 ) */ +#endif /* MACOS || _WIN32 || BC31 */ for ( rc = 0; *fmt && rc != -1; fmt++ ) { switch ( *fmt ) { diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index 3f8408df18..39f26522c2 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -231,8 +231,8 @@ wait4msg( LDAP *ld, int msgid, int all, struct timeval *timeout, #else /* !LDAP_REFERRALS */ #ifdef LDAP_DEBUG if ( ldap_debug & LDAP_DEBUG_TRACE ) { - dump_connection( ld, ld->ld_conns, 1 ); - dump_requests_and_responses( ld ); + ldap_dump_connection( ld, ld->ld_conns, 1 ); + ldap_dump_requests_and_responses( ld ); } #endif /* LDAP_DEBUG */ for ( lc = ld->ld_conns; lc != NULL; lc = lc->lconn_next ) { @@ -276,7 +276,7 @@ wait4msg( LDAP *ld, int msgid, int all, struct timeval *timeout, nextlc = lc->lconn_next; if ( lc->lconn_status == LDAP_CONNST_CONNECTED && - is_read_ready( ld, + ldap_is_read_ready( ld, lc->lconn_sb )) { rc = read1msg( ld, msgid, all, lc->lconn_sb, lc, result ); @@ -326,7 +326,7 @@ read1msg( LDAP *ld, int msgid, int all, Sockbuf *sb, Debug( LDAP_DEBUG_TRACE, "read1msg\n", 0, 0, 0 ); ber_init( &ber, 0 ); - set_ber_options( ld, &ber ); + ldap_set_ber_options( ld, &ber ); /* get the next message */ if ( (tag = ber_get_next( sb, &len, &ber )) @@ -349,7 +349,7 @@ read1msg( LDAP *ld, int msgid, int all, Sockbuf *sb, } #ifdef LDAP_REFERRALS - if (( lr = find_request_by_msgid( ld, id )) == NULL ) { + if (( lr = ldap_find_request_by_msgid( ld, id )) == NULL ) { Debug( LDAP_DEBUG_ANY, "no request for response with msgid %ld (tossing)\n", id, 0, 0 ); @@ -384,7 +384,7 @@ read1msg( LDAP *ld, int msgid, int all, Sockbuf *sb, != LBER_ERROR ) { if ( lderr != LDAP_SUCCESS ) { /* referrals are in error string */ - refer_cnt = chase_referrals( ld, lr, + refer_cnt = ldap_chase_referrals( ld, lr, &lr->lr_res_error, &hadref ); } @@ -455,11 +455,11 @@ lr->lr_res_matched ? lr->lr_res_matched : "" ); } } - free_request( ld, lr ); + ldap_free_request( ld, lr ); } if ( lc != NULL ) { - free_connection( ld, lc, 0, 1 ); + ldap_free_connection( ld, lc, 0, 1 ); } } } @@ -481,7 +481,7 @@ lr->lr_res_matched ? lr->lr_res_matched : "" ); #ifndef NO_CACHE if ( ld->ld_cache != NULL ) { - add_result_to_cache( ld, new ); + ldap_add_result_to_cache( ld, new ); } #endif /* NO_CACHE */ @@ -542,7 +542,13 @@ lr->lr_res_matched ? lr->lr_res_matched : "" ); prev->lm_next = l->lm_next; *result = l; ld->ld_errno = LDAP_SUCCESS; +#ifdef LDAP_WORLD_P16 + /* inclusion of this patch causes searchs to hang on + multiple platforms */ + return( l->lm_msgtype ); +#else return( tag ); +#endif } return( -2 ); /* continue looking */ @@ -557,7 +563,7 @@ build_result_ber( LDAP *ld, BerElement *ber, LDAPRequest *lr ) long along; ber_init( ber, 0 ); - set_ber_options( ld, ber ); + ldap_set_ber_options( ld, ber ); if ( ber_printf( ber, "{it{ess}}", lr->lr_msgid, (long)lr->lr_res_msgtype, lr->lr_res_errno, lr->lr_res_matched ? lr->lr_res_matched : "", @@ -587,7 +593,7 @@ merge_error_info( LDAP *ld, LDAPRequest *parentr, LDAPRequest *lr ) if ( lr->lr_res_errno == LDAP_PARTIAL_RESULTS ) { parentr->lr_res_errno = lr->lr_res_errno; if ( lr->lr_res_error != NULL ) { - (void)append_referral( ld, &parentr->lr_res_error, + (void)ldap_append_referral( ld, &parentr->lr_res_error, lr->lr_res_error ); } } else if ( lr->lr_res_errno != LDAP_SUCCESS && diff --git a/libraries/liblthread/thread.c b/libraries/liblthread/thread.c index f6e516f505..ada0e435a4 100644 --- a/libraries/liblthread/thread.c +++ b/libraries/liblthread/thread.c @@ -42,7 +42,7 @@ pthread_attr_setdetachstate( pthread_attr_t *attr, int detachstate ) int pthread_create( pthread_t *tid, - pthread_attr_t attr, + pthread_attr_t *attr, VFP func, void *arg ) @@ -194,7 +194,7 @@ pthread_attr_setdetachstate( pthread_attr_t *attr, int detachstate ) int pthread_create( pthread_t *tid, - pthread_attr_t attr, + pthread_attr_t *attr, VFP func, void *arg ) @@ -328,6 +328,7 @@ pthread_cond_broadcast( pthread_cond_t *cv ) * * ***********************************************************************/ +#if !defined(__SunOS_5_6) int pthread_attr_init( pthread_attr_t *attr ) { @@ -360,13 +361,14 @@ pthread_attr_setdetachstate( pthread_attr_t *attr, int detachstate ) int pthread_create( pthread_t *tid, - pthread_attr_t attr, + pthread_attr_t *attr, VFP func, void *arg ) { - return( thr_create( NULL, 0, func, arg, attr, tid ) ); + return( thr_create( NULL, 0, func, arg, *attr, tid ) ); } +#endif /* ! sunos56 */ void pthread_yield() @@ -374,6 +376,7 @@ pthread_yield() thr_yield(); } +#if !defined(__SunOS_5_6) void pthread_exit() { @@ -452,6 +455,7 @@ pthread_cond_broadcast( pthread_cond_t *cv ) { return( cond_broadcast( cv ) ); } +#endif /* ! sunos56 */ #else /* end sunos5 threads */ @@ -539,7 +543,7 @@ pthread_attr_setdetachstate( pthread_attr_t *attr, int detachstate ) int pthread_create( pthread_t *tid, - pthread_attr_t attr, + pthread_attr_t *attr, VFP func, void *arg ) diff --git a/servers/ldapd/main.c b/servers/ldapd/main.c index 5626a34c4f..9edd4b532e 100644 --- a/servers/ldapd/main.c +++ b/servers/ldapd/main.c @@ -42,6 +42,13 @@ #include #endif /* USE_SYSCONF */ +#ifdef TCP_WRAPPERS +#include + +int allow_severity = LOG_INFO; +int deny_severity = LOG_NOTICE; +#endif /* TCP_WRAPPERS */ + void log_and_exit(); static set_socket(); static do_queries(); @@ -393,10 +400,31 @@ char **argv; hp = gethostbyaddr( (char *) &(from.sin_addr.s_addr), sizeof(from.sin_addr.s_addr), AF_INET ); + +#ifdef TCP_WRAPPERS + if ( !hosts_ctl("ldapd", (hp == NULL) ? "unknown" : hp->h_name, + inet_ntoa( from.sin_addr ), STRING_UNKNOWN ) { + + Debug( LDAP_DEBUG_ARGS, "connection from %s (%s) denied.\n", + (hp == NULL) ? "unknown" : hp->h_name, + inet_ntoa( from.sin_addr ), 0 ); + + if ( dosyslog ) { + syslog( LOG_NOTICE, "connection from %s (%s) denied.", + (hp == NULL) ? "unknown" : hp->h_name, + inet_ntoa( from.sin_addr ) ); + } + + close(ns); + continue; + } +#endif /* TCP_WRAPPERS */ + Debug( LDAP_DEBUG_ARGS, "connection from %s (%s)\n", (hp == NULL) ? "unknown" : hp->h_name, inet_ntoa( from.sin_addr ), 0 ); + if ( dosyslog ) { syslog( LOG_INFO, "connection from %s (%s)", (hp == NULL) ? "unknown" : hp->h_name, diff --git a/servers/slapd/back-ldbm/index.c b/servers/slapd/back-ldbm/index.c index 3d75a091d3..100b058b73 100644 --- a/servers/slapd/back-ldbm/index.c +++ b/servers/slapd/back-ldbm/index.c @@ -130,25 +130,26 @@ index_read( realval = val; tmpval = NULL; if ( prefix != '\0' ) { - int len; + int len = strlen( val ); - if ( (len = strlen( val )) < sizeof(buf) ) { - buf[0] = prefix; - strcpy( &buf[1], val ); + if ( (len + 2) < sizeof(buf) ) { realval = buf; } else { /* value + prefix + null */ tmpval = (char *) ch_malloc( len + 2 ); - tmpval[0] = prefix; - strcat( &tmpval[1], val ); realval = tmpval; } + realval[0] = prefix; + strcpy( &realval[1], val ); } key.dptr = realval; key.dsize = strlen( realval ) + 1; idl = idl_fetch( be, db, key ); + if ( tmpval != NULL ) { + free( tmpval ); + } ldbm_cache_close( be, db ); @@ -181,19 +182,17 @@ add_value( tmpval = NULL; idl = NULL; if ( prefix != '\0' ) { - int len; + int len = strlen( val ); - if ( (len = strlen( val )) < sizeof(buf) ) { - buf[0] = prefix; - strcpy( &buf[1], val ); + if ( (len + 2) < sizeof(buf) ) { realval = buf; } else { /* value + prefix + null */ tmpval = (char *) ch_malloc( len + 2 ); - tmpval[0] = prefix; - strcat( &tmpval[1], val ); realval = tmpval; } + realval[0] = prefix; + strcpy( &realval[1], val ); } key.dptr = realval; diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index 5bb56bdcf6..34f49ea6d9 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -31,6 +31,13 @@ #include #endif /* USE_SYSCONF */ +#ifdef TCP_WRAPPERS +#include + +int allow_severity = LOG_INFO; +int deny_severity = LOG_NOTICE; +#endif /* TCP_WRAPPERS */ + extern Operation *op_add(); #ifndef SYSERRLIST_IN_STDIO @@ -145,7 +152,7 @@ slapd_daemon( #else (void) SIGNAL( SIGUSR1, (void *) do_nothing ); #endif -#ifdef SIGSTKFLT +#ifdef SIGUNUSED (void) SIGNAL( SIGUNUSED, (void *) set_shutdown ); #else (void) SIGNAL( SIGUSR2, (void *) set_shutdown ); @@ -178,6 +185,9 @@ slapd_daemon( struct timeval *tvp; int len, pid; + char *client_name; + char *client_addr; + FD_ZERO( &writefds ); FD_ZERO( &readfds ); FD_SET( tcps, &readfds ); @@ -250,8 +260,9 @@ slapd_daemon( } if ( ioctl( ns, FIONBIO, (caddr_t) &on ) == -1 ) { Debug( LDAP_DEBUG_ANY, - "FIONBIO ioctl on %d faled\n", ns, 0, 0 ); + "FIONBIO ioctl on %d failed\n", ns, 0, 0 ); } + c[ns].c_sb.sb_sd = ns; Debug( LDAP_DEBUG_CONNS, "new connection on %d\n", ns, 0, 0 ); @@ -259,43 +270,76 @@ slapd_daemon( pthread_mutex_lock( &ops_mutex ); c[ns].c_connid = num_conns++; pthread_mutex_unlock( &ops_mutex ); + len = sizeof(from); + if ( getpeername( ns, (struct sockaddr *) &from, &len ) == 0 ) { - char *s; -#ifdef REVERSE_LOOKUP + char *s; + client_addr = inet_ntoa( from.sin_addr ); + +#if defined(REVERSE_LOOKUP) || defined(TCP_WRAPPERS) hp = gethostbyaddr( (char *) &(from.sin_addr.s_addr), sizeof(from.sin_addr.s_addr), AF_INET ); -#else - hp = NULL; -#endif - Statslog( LDAP_DEBUG_STATS, - "conn=%d fd=%d connection from %s (%s)\n", - c[ns].c_connid, ns, hp == NULL ? "unknown" - : hp->h_name, inet_ntoa( from.sin_addr ), - 0 ); + if(hp) { + client_name = hp->h_name; - if ( c[ns].c_addr != NULL ) { - free( c[ns].c_addr ); - } - c[ns].c_addr = strdup( inet_ntoa( - from.sin_addr ) ); - if ( c[ns].c_domain != NULL ) { - free( c[ns].c_domain ); - } - c[ns].c_domain = strdup( hp == NULL ? "" : - hp->h_name ); - /* normalize the domain */ - for ( s = c[ns].c_domain; *s; s++ ) { - *s = TOLOWER( *s ); + /* normalize the domain */ + for ( s = client_name; *s; s++ ) { + *s = TOLOWER( *s ); + } + + } else { + client_name = NULL; } +#else + client_name = NULL; +#endif + } else { + client_name = NULL;; + client_addr = NULL; + } + +#ifdef TCP_WRAPPERS + if(!hosts_ctl("slapd", client_name, client_addr, + STRING_UNKNOWN)) + { + /* DENY ACCESS */ Statslog( LDAP_DEBUG_STATS, - "conn=%d fd=%d connection from unknown\n", - c[ns].c_connid, ns, 0, 0, 0 ); + "conn=%d fd=%d connection from %s (%s) denied.\n", + c[ns].c_connid, ns, + client_name == NULL ? "unknown" : client_name, + client_addr == NULL ? "unknown" : client_addr, + 0 ); + + close(ns); + pthread_mutex_unlock( &new_conn_mutex ); + continue; } +#endif /* TCP_WRAPPERS */ + + Statslog( LDAP_DEBUG_STATS, + "conn=%d fd=%d connection from %s (%s) accepted.\n", + c[ns].c_connid, ns, + client_name == NULL ? "unknown" : client_name, + client_addr == NULL ? "unknown" : client_addr, + 0 ); + + if ( c[ns].c_addr != NULL ) { + free( c[ns].c_addr ); + } + c[ns].c_addr = strdup( client_addr ); + + if ( c[ns].c_domain != NULL ) { + free( c[ns].c_domain ); + } + + c[ns].c_domain = strdup( client_name == NULL + ? "" : client_name ); + pthread_mutex_lock( &c[ns].c_dnmutex ); if ( c[ns].c_dn != NULL ) { free( c[ns].c_dn ); diff --git a/servers/slapd/filter.c b/servers/slapd/filter.c index 8d990b361d..5b8e2b35db 100644 --- a/servers/slapd/filter.c +++ b/servers/slapd/filter.c @@ -135,6 +135,7 @@ get_filter( Connection *conn, BerElement *ber, Filter **filt, char **fstr ) Debug( LDAP_DEBUG_FILTER, "AND\n", 0, 0, 0 ); if ( (err = get_filter_list( conn, ber, &f->f_and, &ftmp )) == 0 ) { + if (ftmp == NULL) ftmp = strdup(""); *fstr = ch_malloc( 4 + strlen( ftmp ) ); sprintf( *fstr, "(&%s)", ftmp ); free( ftmp ); @@ -145,6 +146,7 @@ get_filter( Connection *conn, BerElement *ber, Filter **filt, char **fstr ) Debug( LDAP_DEBUG_FILTER, "OR\n", 0, 0, 0 ); if ( (err = get_filter_list( conn, ber, &f->f_or, &ftmp )) == 0 ) { + if (ftmp == NULL) ftmp = strdup(""); *fstr = ch_malloc( 4 + strlen( ftmp ) ); sprintf( *fstr, "(|%s)", ftmp ); free( ftmp ); @@ -155,6 +157,7 @@ get_filter( Connection *conn, BerElement *ber, Filter **filt, char **fstr ) Debug( LDAP_DEBUG_FILTER, "NOT\n", 0, 0, 0 ); (void) ber_skip_tag( ber, &len ); if ( (err = get_filter( conn, ber, &f->f_not, &ftmp )) == 0 ) { + if (ftmp == NULL) ftmp = strdup(""); *fstr = ch_malloc( 4 + strlen( ftmp ) ); sprintf( *fstr, "(!%s)", ftmp ); free( ftmp ); diff --git a/tests/scripts/all b/tests/scripts/all index 451c739caa..8d111d2c71 100755 --- a/tests/scripts/all +++ b/tests/scripts/all @@ -19,5 +19,7 @@ for i in $SCRIPTDIR/test*; do echo ">>>>> $CMD failed (exit $RC)" exit $RC fi + echo ">>>>> waiting 5 seconds for things to exit" + sleep 5 echo done diff --git a/tests/scripts/defines.sh b/tests/scripts/defines.sh index 6d8bf2f391..221ea0d023 100755 --- a/tests/scripts/defines.sh +++ b/tests/scripts/defines.sh @@ -20,6 +20,8 @@ PASSWD=secret BABSDN="cn=Barbara Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US" BJORNSDN="cn=Bjorn Jensen, ou=Information Technology Division, ou=People, o=University of Michigan, c=US" JAJDN="cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US" +MASTERLOG=$DBDIR/master.log +SLAVELOG=$DBDIR/slave.log SEARCHOUT=$DBDIR/ldapsearch.out MASTEROUT=$DBDIR/master.out SLAVEOUT=$DBDIR/slave.out diff --git a/tests/scripts/makeldbm.sh b/tests/scripts/makeldbm.sh index bb2aac035c..44834903a9 100755 --- a/tests/scripts/makeldbm.sh +++ b/tests/scripts/makeldbm.sh @@ -4,7 +4,7 @@ echo "Cleaning up in $DBDIR..." -rm -f $DBDIR/* +rm -f $DBDIR/[^C]* echo "Running ldif2ldbm to build slapd database..." $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools diff --git a/tests/scripts/test001-ldif2ldbm b/tests/scripts/test001-ldif2ldbm index d22e04c8e0..b97a6f77e4 100755 --- a/tests/scripts/test001-ldif2ldbm +++ b/tests/scripts/test001-ldif2ldbm @@ -5,7 +5,7 @@ echo "Cleaning up in $DBDIR..." -rm -f $DBDIR/* +rm -f $DBDIR/[^C]* echo "Running ldif2ldbm to build slapd database..." $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools @@ -16,7 +16,7 @@ if [ $RC != 0 ]; then fi echo "Starting slapd on TCP/IP port $PORT..." -$SLAPD -f $CONF -p $PORT -d 1 > /dev/null 2>&1 & +$SLAPD -f $CONF -p $PORT -d 1 > $MASTERLOG 2>&1 & PID=$! echo "Using ldapsearch to retrieve all the entries..." diff --git a/tests/scripts/test002-populate b/tests/scripts/test002-populate index c04d1f5f65..62d6923bbc 100755 --- a/tests/scripts/test002-populate +++ b/tests/scripts/test002-populate @@ -5,10 +5,10 @@ echo "Cleaning up in $DBDIR..." -rm -f $DBDIR/* +rm -f $DBDIR/[^C]* echo "Starting slapd on TCP/IP port $PORT..." -$SLAPD -f $CONF -p $PORT -d 1 > /dev/null 2>&1 & +$SLAPD -f $CONF -p $PORT -d 1 > $MASTERLOG 2>&1 & PID=$! echo "Using ldapsearch to check that slapd is running..." diff --git a/tests/scripts/test003-search b/tests/scripts/test003-search index 0912550608..a9655da2ad 100755 --- a/tests/scripts/test003-search +++ b/tests/scripts/test003-search @@ -4,7 +4,7 @@ echo "Cleaning up in $DBDIR..." -rm -f $DBDIR/* +rm -f $DBDIR/[^C]* echo "Running ldif2ldbm to build slapd database..." $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools @@ -15,7 +15,7 @@ if [ $RC != 0 ]; then fi echo "Starting slapd on TCP/IP port $PORT..." -$SLAPD -f $CONF -p $PORT -d 1 > /dev/null 2>&1 & +$SLAPD -f $CONF -p $PORT -d 1 > $MASTERLOG 2>&1 & PID=$! echo "Testing slapd searching..." diff --git a/tests/scripts/test004-modify b/tests/scripts/test004-modify index 09a4fdfee1..35caa4c518 100755 --- a/tests/scripts/test004-modify +++ b/tests/scripts/test004-modify @@ -4,7 +4,7 @@ echo "Cleaning up in $DBDIR..." -rm -f $DBDIR/* +rm -f $DBDIR/[^C]* echo "Running ldif2ldbm to build slapd database..." $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools @@ -15,7 +15,7 @@ if [ $RC != 0 ]; then fi echo "Starting slapd on TCP/IP port $PORT..." -$SLAPD -f $CONF -p $PORT -d 1 > /dev/null 2>&1 & +$SLAPD -f $CONF -p $PORT -d 1 > $MASTERLOG 2>&1 & PID=$! echo "Testing slapd modify operations..." diff --git a/tests/scripts/test006-acls b/tests/scripts/test006-acls index ec1c964d10..d4b8ee3ad1 100755 --- a/tests/scripts/test006-acls +++ b/tests/scripts/test006-acls @@ -4,7 +4,7 @@ echo "Cleaning up in $DBDIR..." -rm -f $DBDIR/* +rm -f $DBDIR/[^C]* echo "Running ldif2ldbm to build slapd database..." $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools @@ -15,7 +15,7 @@ if [ $RC != 0 ]; then fi echo "Starting slapd on TCP/IP port $PORT..." -$SLAPD -f $ACLCONF -p $PORT -d 1 > /dev/null 2>&1 & +$SLAPD -f $ACLCONF -p $PORT -d 1 > $MASTERLOG 2>&1 & PID=$! echo "Testing slapd access control..." diff --git a/tests/scripts/test007-replication b/tests/scripts/test007-replication index c0f49136c5..cfc24edd5e 100755 --- a/tests/scripts/test007-replication +++ b/tests/scripts/test007-replication @@ -13,16 +13,16 @@ . scripts/defines.sh echo "Cleaning up in $DBDIR..." -rm -f $DBDIR/* +rm -f $DBDIR/[^C]* echo "Cleaning up in $REPLDIR..." -rm -f $REPLDIR/* +rm -f $REPLDIR/[^C]* echo "Starting master slapd on TCP/IP port $PORT..." -$SLAPD -f $MASTERCONF -p $PORT -d 1 > /dev/null 2>&1 & +$SLAPD -f $MASTERCONF -p $PORT -d 1 > $MASTERLOG 2>&1 & PID=$! echo "Starting slave slapd on TCP/IP port $SLAVEPORT..." -$SLAPD -f $SLAVECONF -p $SLAVEPORT -d 1 > /dev/null 2>&1 & +$SLAPD -f $SLAVECONF -p $SLAVEPORT -d 1 > $SLAVELOG 2>&1 & SLAVEPID=$! echo "Using ldapsearch to check that master slapd is running..."