2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 01:49:11 +00:00

Use ldap_msgfree() instead of ldap_init() for the lber.h test.

The ldap_init() function is marked as deprecated and not defined
by default on some systems.  This can cause an error for compilers
that do not support implicit function declarations.
From Florian Weimer.
This commit is contained in:
Todd C. Miller 2023-04-26 11:10:46 -06:00
parent 47ae92d034
commit b83140e0f1
2 changed files with 2 additions and 2 deletions

2
configure vendored
View File

@ -31515,7 +31515,7 @@ else case e in #(
int int
main (void) main (void)
{ {
(void)ldap_init(0, 0) return ldap_msgfree(NULL)
; ;
return 0; return 0;
} }

View File

@ -52,7 +52,7 @@ AC_DEFUN([SUDO_CHECK_LDAP], [
#include <lber.h>]) #include <lber.h>])
AC_CACHE_CHECK([whether lber.h is needed when including ldap.h], [sudo_cv_header_lber_h], [ AC_CACHE_CHECK([whether lber.h is needed when including ldap.h], [sudo_cv_header_lber_h], [
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h> AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <ldap.h>]], [[(void)ldap_init(0, 0)]])], [ #include <ldap.h>]], [[return ldap_msgfree(NULL)]])], [
# No need to explicitly include lber.h when including ldap.h. # No need to explicitly include lber.h when including ldap.h.
sudo_cv_header_lber_h=no sudo_cv_header_lber_h=no
], [ ], [