From 57012d9c1cd622aa8b1dec6b5afc9a848523741a Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 12 Sep 2002 21:39:01 +0000 Subject: [PATCH] Fix tempnam problems (by removing it) --- CHANGES | 2 +- configure | 75 +++--------------------------------- configure.in | 7 ---- include/ac/unistd.h | 6 --- include/portable.h.in | 6 --- libraries/liblutil/tempnam.c | 47 ---------------------- 6 files changed, 7 insertions(+), 136 deletions(-) delete mode 100644 libraries/liblutil/tempnam.c diff --git a/CHANGES b/CHANGES index 416be1f00c..fca3a01853 100644 --- a/CHANGES +++ b/CHANGES @@ -12,7 +12,7 @@ OpenLDAP 2.0.26 Engineering Updated back-ldbm reindexing - slapindex rebuilds dn2id index Build environment Require version 1.5 if Cyrus SASL is present - + Remove tempnam checking and replacment implementation OpenLDAP 2.0.25 Release Fixed slapd extended op reqdata crash bug (ITS#1721) diff --git a/configure b/configure index 35cf07e6dc..8e65afdbe3 100755 --- a/configure +++ b/configure @@ -16964,82 +16964,19 @@ fi done -for ac_func in getopt tempnam -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:16971: checking for $ac_func" >&5 -if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); -char (*f)(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -f = $ac_func; -#endif - -; return 0; } -EOF -if { (eval echo configure:17000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 -LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}" -fi -done - - - if test "$ac_cv_func_getopt" != yes; then LIBSRCS="$LIBSRCS getopt.c" fi -if test "$ac_cv_func_tempnam" != yes; then - LIBSRCS="$LIBSRCS tempnam.c" -fi - # Check Configuration echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6 -echo "configure:17037: checking declaration of sys_errlist" >&5 +echo "configure:16974: 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 < @@ -17052,7 +16989,7 @@ int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:17056: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:16993: \"$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 @@ -17075,20 +17012,20 @@ EOF echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6 -echo "configure:17079: checking existence of sys_errlist" >&5 +echo "configure:17016: 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 < int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:17092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:17029: \"$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 diff --git a/configure.in b/configure.in index ddc21aebf5..261554c763 100644 --- a/configure.in +++ b/configure.in @@ -2108,17 +2108,10 @@ AC_CHECK_FUNCS( \ sendto \ ) -dnl We actually may need to replace more than this. -AC_REPLACE_FUNCS(getopt tempnam) - if test "$ac_cv_func_getopt" != yes; then LIBSRCS="$LIBSRCS getopt.c" fi -if test "$ac_cv_func_tempnam" != yes; then - LIBSRCS="$LIBSRCS tempnam.c" -fi - dnl ---------------------------------------------------------------- # Check Configuration OL_SYS_ERRLIST diff --git a/include/ac/unistd.h b/include/ac/unistd.h index 4902554ed4..5048c2927b 100644 --- a/include/ac/unistd.h +++ b/include/ac/unistd.h @@ -55,12 +55,6 @@ LDAP_LUTIL_F(char*)(lutil_getpass) LDAP_P((const char *getpass)); LDAP_LIBC_V (int) optind, opterr, optopt; #endif -#ifndef HAVE_TEMPNAM - LDAP_LUTIL_F(char *)(tempnam) LDAP_P(( - const char *tmpdir, - const char *prefix)); -#endif - /* use lutil file locking */ #define ldap_lockf(x) lutil_lockf(x) #define ldap_unlockf(x) lutil_unlockf(x) diff --git a/include/portable.h.in b/include/portable.h.in index 96274e822c..868fdc879f 100644 --- a/include/portable.h.in +++ b/include/portable.h.in @@ -169,9 +169,6 @@ /* Define if you have the gethostname function. */ #undef HAVE_GETHOSTNAME -/* Define if you have the getopt function. */ -#undef HAVE_GETOPT - /* Define if you have the getpass function. */ #undef HAVE_GETPASS @@ -304,9 +301,6 @@ /* Define if you have the sysconf function. */ #undef HAVE_SYSCONF -/* Define if you have the tempnam function. */ -#undef HAVE_TEMPNAM - /* Define if you have the thr_getconcurrency function. */ #undef HAVE_THR_GETCONCURRENCY diff --git a/libraries/liblutil/tempnam.c b/libraries/liblutil/tempnam.c deleted file mode 100644 index d0643b2c47..0000000000 --- a/libraries/liblutil/tempnam.c +++ /dev/null @@ -1,47 +0,0 @@ -/* $OpenLDAP$ */ -#include "portable.h" - -#ifndef HAVE_TEMPNAM - -#include - -#include -#include -#include - -#include "lutil.h" -#include "ldap_config.h" - -char * -(tempnam)( const char *dir, const char *pfx ) -{ - char *s; - - if ( dir == NULL ) { - dir = LDAP_TMPDIR; - } - -/* - * allocate space for dir + '/' + pfx (up to 5 chars) + 6 trailing 'X's + 0 byte - */ - if (( s = (char *)malloc( strlen( dir ) + 14 )) == NULL ) { - return( NULL ); - } - - strcpy( s, dir ); - strcat( s, "/" ); - if ( pfx != NULL ) { - strcat( s, pfx ); - } - strcat( s, "XXXXXX" ); - mktemp( s ); - - if ( *s == '\0' ) { - free( s ); - s = NULL; - } - - return( s ); -} - -#endif /* TEMPNAM */ -- 2.39.2