mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-18 18:18:06 -05:00
Fix tempnam problems (by removing it)
This commit is contained in:
parent
ddf22dec10
commit
57012d9c1c
6 changed files with 7 additions and 136 deletions
2
CHANGES
2
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)
|
||||
|
|
|
|||
75
configure
vendored
75
configure
vendored
|
|
@ -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 <<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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
Loading…
Reference in a new issue