]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Fix tempnam problems (by removing it)
authorKurt Zeilenga <kurt@openldap.org>
Thu, 12 Sep 2002 21:39:01 +0000 (21:39 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 12 Sep 2002 21:39:01 +0000 (21:39 +0000)
CHANGES
configure
configure.in
include/ac/unistd.h
include/portable.h.in
libraries/liblutil/tempnam.c [deleted file]

diff --git a/CHANGES b/CHANGES
index 416be1f00ca9084157b993906738b535edc74b73..fca3a01853c29a83e2567375706e6a9809626e30 100644 (file)
--- 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)
index 35cf07e6dc92b873ac04c111337e48ccc99a1484..8e65afdbe39193225e18d98db273f6513e3f70f5 100755 (executable)
--- a/configure
+++ b/configure
 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 <<EOF
-#line 16976 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func(); below.  */
-#include <assert.h>
-/* 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 <<EOF
-#define $ac_tr_func 1
-EOF
-else
-  echo "$ac_t""no" 1>&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 <<EOF
-#line 17043 "configure"
+#line 16980 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -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 <<EOF
-#line 17085 "configure"
+#line 17022 "configure"
 #include "confdefs.h"
 #include <errno.h>
 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
index ddc21aebf5e5e81b54258757e26a0a592d96037f..261554c763b0907011418f2f8e82e5bc97cfcbe2 100644 (file)
@@ -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
index 4902554ed4ef89748c20054b7411f4a2029e2b77..5048c2927bccb43a8fc7e3307b64abb2294cb622 100644 (file)
@@ -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)
index 96274e822c880695fb5d8a7457d394a8776a291d..868fdc879f730a27d32e23b5f33a27789e89069d 100644 (file)
 /* 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
 
 /* 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 (file)
index d0643b2..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/* $OpenLDAP$ */
-#include "portable.h"
-
-#ifndef HAVE_TEMPNAM
-
-#include <stdio.h>
-
-#include <ac/stdlib.h>
-#include <ac/string.h>
-#include <ac/unistd.h>
-
-#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 */