mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-05 14:42:10 -05:00
define _REENTRANT & _THREAD_SAFE to pull in reentrant/threadsafe prototypes.
modify apps to use TOLOWER/TOUPPER macros to ensure isupper/islower is called when approprate.
This commit is contained in:
parent
6b0a490026
commit
4646b76608
10 changed files with 266 additions and 311 deletions
|
|
@ -5,6 +5,13 @@
|
|||
Leave the following blank line there!! Autoheader needs it. */
|
||||
|
||||
|
||||
|
||||
/* define this if needed to get reentrant functions */
|
||||
#undef _REENTRANT
|
||||
|
||||
/* define this if needed to get threadsafe functions */
|
||||
#undef _THREAD_SAFE
|
||||
|
||||
/* define this if toupper() requires tolower() check */
|
||||
#undef C_UPPER_LOWER
|
||||
|
||||
|
|
|
|||
|
|
@ -10,11 +10,10 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <ac/syslog.h>
|
||||
#include <ac/ctype.h>
|
||||
#include <ac/string.h>
|
||||
|
||||
#include <ac/syslog.h>
|
||||
|
||||
#include "ldapconfig.h"
|
||||
#include "rcpt500.h"
|
||||
|
|
@ -365,7 +364,7 @@ find_command( text, argp )
|
|||
|
||||
p = text;
|
||||
for ( s = argbuf; *p != '\0'; ++p ) {
|
||||
*s++ = tolower( *p );
|
||||
*s++ = TOLOWER( *p );
|
||||
}
|
||||
*s = '\0';
|
||||
|
||||
|
|
|
|||
|
|
@ -291,9 +291,7 @@ static void str2upper( s )
|
|||
char *p;
|
||||
|
||||
for ( p = s; *p != '\0'; ++p ) {
|
||||
if ( islower( *p )) {
|
||||
*p = toupper( *p );
|
||||
}
|
||||
*p = TOUPPER( *p );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -360,9 +358,7 @@ krbgetpass( user, inst, realm, pw, key )
|
|||
#ifdef HAVE_AFS_KERBEROS
|
||||
strcpy( lcrealm, realm );
|
||||
for ( p = lcrealm; *p != '\0'; ++p ) {
|
||||
if ( isupper( *p )) {
|
||||
*p = tolower( *p );
|
||||
}
|
||||
*p = TOLOWER( *p );
|
||||
}
|
||||
|
||||
ka_StringToKey( passwd, lcrealm, key );
|
||||
|
|
|
|||
33
configure.in
33
configure.in
|
|
@ -223,7 +223,6 @@ AC_AIX
|
|||
AC_ISC_POSIX
|
||||
AC_MINIX
|
||||
|
||||
dnl ----------------------------------------------------------------
|
||||
dnl Checks for libraries
|
||||
|
||||
dnl Find socket()
|
||||
|
|
@ -475,16 +474,16 @@ int argc; char **argv;
|
|||
fi
|
||||
fi
|
||||
|
||||
dnl check for reentrant/threadsafe functions
|
||||
AC_CHECK_FUNCS( \
|
||||
feof_unlocked \
|
||||
unlocked_feof \
|
||||
ftrylockfile \
|
||||
flockfile \
|
||||
putc_unlocked \
|
||||
gmtime_r \
|
||||
strtok_r \
|
||||
)
|
||||
dnl dnl check for reentrant/threadsafe functions
|
||||
dnl AC_CHECK_FUNCS( \
|
||||
dnl feof_unlocked \
|
||||
dnl unlocked_feof \
|
||||
dnl ftrylockfile \
|
||||
dnl flockfile \
|
||||
dnl putc_unlocked \
|
||||
dnl gmtime_r \
|
||||
dnl strtok_r \
|
||||
dnl )
|
||||
|
||||
dnl restore DEFS/LIBS
|
||||
CPPFLAGS="$save_CPPFLAGS"
|
||||
|
|
@ -592,6 +591,18 @@ if test $ol_with_threads = manual ; then
|
|||
AC_CHECK_HEADERS(thread.h synch.h)
|
||||
fi
|
||||
|
||||
if test $ol_with_threads = yes ; then
|
||||
dnl needed to get reentrant/threadsafe versions
|
||||
dnl
|
||||
dnl hopefully this will not cause problems with
|
||||
dnl non-threaded apps
|
||||
dnl
|
||||
AC_DEFINE(_REENTRANT,1)
|
||||
AC_DEFINE(_THREAD_SAFE,1)
|
||||
fi
|
||||
|
||||
dnl ----------------------------------------------------------------
|
||||
|
||||
if test $ol_link_threads = no ; then
|
||||
if test $ol_with_threads = yes ; then
|
||||
AC_MSG_ERROR([no suitable thread support])
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/* portable.h.bot begin */
|
||||
|
||||
#ifdef HAVE_STDDEF_H
|
||||
# include <stddef.h>
|
||||
|
|
@ -6,3 +7,5 @@
|
|||
#include "ldap_cdefs.h"
|
||||
|
||||
#endif /* _LDAP_PORTABLE_H */
|
||||
|
||||
/* portable.h.bot end */
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* include/portable.h.in. Generated automatically from configure.in by autoheader. */
|
||||
/* portable.h.top begin */
|
||||
/*
|
||||
Copyright 1998 The OpenLDAP Foundation, Redwood City, California, USA
|
||||
All rights reserved.
|
||||
|
|
@ -31,6 +32,7 @@ is provided ``as is'' without express or implied warranty.
|
|||
#ifndef _LDAP_PORTABLE_H
|
||||
#define _LDAP_PORTABLE_H
|
||||
|
||||
/* portable.h.top end */
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
|
|
@ -104,6 +106,12 @@ is provided ``as is'' without express or implied warranty.
|
|||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef uid_t
|
||||
|
||||
/* define this if needed to get reentrant functions */
|
||||
#undef _REENTRANT
|
||||
|
||||
/* define this if needed to get threadsafe functions */
|
||||
#undef _THREAD_SAFE
|
||||
|
||||
/* define this if toupper() requires tolower() check */
|
||||
#undef C_UPPER_LOWER
|
||||
|
||||
|
|
@ -236,18 +244,9 @@ is provided ``as is'' without express or implied warranty.
|
|||
/* Define if you have the bcopy function. */
|
||||
#undef HAVE_BCOPY
|
||||
|
||||
/* Define if you have the feof_unlocked function. */
|
||||
#undef HAVE_FEOF_UNLOCKED
|
||||
|
||||
/* Define if you have the flock function. */
|
||||
#undef HAVE_FLOCK
|
||||
|
||||
/* Define if you have the flockfile function. */
|
||||
#undef HAVE_FLOCKFILE
|
||||
|
||||
/* Define if you have the ftrylockfile function. */
|
||||
#undef HAVE_FTRYLOCKFILE
|
||||
|
||||
/* Define if you have the getdtablesize function. */
|
||||
#undef HAVE_GETDTABLESIZE
|
||||
|
||||
|
|
@ -260,9 +259,6 @@ is provided ``as is'' without express or implied warranty.
|
|||
/* Define if you have the gettimeofday function. */
|
||||
#undef HAVE_GETTIMEOFDAY
|
||||
|
||||
/* Define if you have the gmtime_r function. */
|
||||
#undef HAVE_GMTIME_R
|
||||
|
||||
/* Define if you have the lockf function. */
|
||||
#undef HAVE_LOCKF
|
||||
|
||||
|
|
@ -287,9 +283,6 @@ is provided ``as is'' without express or implied warranty.
|
|||
/* Define if you have the pthread_yield function. */
|
||||
#undef HAVE_PTHREAD_YIELD
|
||||
|
||||
/* Define if you have the putc_unlocked function. */
|
||||
#undef HAVE_PUTC_UNLOCKED
|
||||
|
||||
/* Define if you have the sched_yield function. */
|
||||
#undef HAVE_SCHED_YIELD
|
||||
|
||||
|
|
@ -332,9 +325,6 @@ is provided ``as is'' without express or implied warranty.
|
|||
/* Define if you have the strtod function. */
|
||||
#undef HAVE_STRTOD
|
||||
|
||||
/* Define if you have the strtok_r function. */
|
||||
#undef HAVE_STRTOK_R
|
||||
|
||||
/* Define if you have the strtol function. */
|
||||
#undef HAVE_STRTOL
|
||||
|
||||
|
|
@ -350,9 +340,6 @@ is provided ``as is'' without express or implied warranty.
|
|||
/* Define if you have the thr_setconcurrency function. */
|
||||
#undef HAVE_THR_SETCONCURRENCY
|
||||
|
||||
/* Define if you have the unlocked_feof function. */
|
||||
#undef HAVE_UNLOCKED_FEOF
|
||||
|
||||
/* Define if you have the vsnprintf function. */
|
||||
#undef HAVE_VSNPRINTF
|
||||
|
||||
|
|
@ -508,6 +495,7 @@ is provided ``as is'' without express or implied warranty.
|
|||
|
||||
/* Define if you have the socket library (-lsocket). */
|
||||
#undef HAVE_LIBSOCKET
|
||||
/* portable.h.bot begin */
|
||||
|
||||
#ifdef HAVE_STDDEF_H
|
||||
# include <stddef.h>
|
||||
|
|
@ -516,3 +504,5 @@ is provided ``as is'' without express or implied warranty.
|
|||
#include "ldap_cdefs.h"
|
||||
|
||||
#endif /* _LDAP_PORTABLE_H */
|
||||
|
||||
/* portable.h.bot end */
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/* portable.h.top begin */
|
||||
/*
|
||||
Copyright 1998 The OpenLDAP Foundation, Redwood City, California, USA
|
||||
All rights reserved.
|
||||
|
|
@ -30,3 +31,4 @@ is provided ``as is'' without express or implied warranty.
|
|||
#ifndef _LDAP_PORTABLE_H
|
||||
#define _LDAP_PORTABLE_H
|
||||
|
||||
/* portable.h.top end */
|
||||
|
|
|
|||
|
|
@ -251,9 +251,7 @@ do_entry2text(
|
|||
freevals = 1;
|
||||
}
|
||||
|
||||
if ( islower( *attr )) { /* cosmetic -- upcase attr. name */
|
||||
*attr = toupper( *attr );
|
||||
}
|
||||
*attr = TOUPPER( *attr );
|
||||
|
||||
err = do_vals2text( ld, buf, vals, attr, labelwidth,
|
||||
LDAP_SYN_CASEIGNORESTR, writeproc, writeparm, eol,
|
||||
|
|
@ -302,14 +300,14 @@ do_entry2text(
|
|||
if ( show && LDAP_GET_SYN_TYPE( colp->ti_syntaxid )
|
||||
== LDAP_SYN_TYPE_BOOLEAN && LDAP_IS_TMPLITEM_OPTION_SET(
|
||||
colp, LDAP_DITEM_OPT_HIDEIFFALSE ) &&
|
||||
toupper( vals[ 0 ][ 0 ] ) != 'T' ) {
|
||||
TOUPPER( vals[ 0 ][ 0 ] ) != 'T' ) {
|
||||
show = 0;
|
||||
}
|
||||
|
||||
if ( colp->ti_syntaxid == LDAP_SYN_SEARCHACTION ) {
|
||||
if (( opts & LDAP_DISP_OPT_DOSEARCHACTIONS ) != 0 ) {
|
||||
if ( colp->ti_attrname == NULL || ( show &&
|
||||
toupper( vals[ 0 ][ 0 ] ) == 'T' )) {
|
||||
TOUPPER( vals[ 0 ][ 0 ] ) == 'T' )) {
|
||||
err = searchaction( ld, buf, base, entry, dn, colp,
|
||||
labelwidth, rdncount, writeproc,
|
||||
writeparm, eol, urlprefix );
|
||||
|
|
@ -689,7 +687,7 @@ do_vals2text(
|
|||
break;
|
||||
|
||||
case LDAP_SYN_BOOLEAN:
|
||||
outval = toupper( outval[ 0 ] ) == 'T' ? "TRUE" : "FALSE";
|
||||
outval = TOUPPER( outval[ 0 ] ) == 'T' ? "TRUE" : "FALSE";
|
||||
++writeoutval;
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -498,7 +498,7 @@ generate_new_centroids(
|
|||
/* normalize the value */
|
||||
for ( s = val[j]; *s; s++ ) {
|
||||
if ( isascii( *s ) ) {
|
||||
*s = tolower( *s );
|
||||
*s = TOLOWER( *s );
|
||||
}
|
||||
last = *s;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue