2 Commits

Author SHA256 Message Date
c3023a9c5d - Link against ldap.so instead of ldap_r.so; the former now provides
thread-safety and the latter is a symlink which may not exist
  (bsc#1249966)
  * drop autofs-use-libldap_r-instead-of-libldap-for-thread-safety.patch
- Fix autofs-5.1.1-dbus-udisks-monitor.patch (bsc#1246612) to account for:
  * d2feac6784b6 autofs-5.1.6 - make autofs.a a shared library
  * bcd8e1b642e9 autofs-5.0.7 - use LIBS for link libraries
2025-10-16 11:38:24 +11:00
58974632e6 Sync changes to SLFO-1.2 branch 2025-08-20 09:03:40 +02:00
3 changed files with 8 additions and 77 deletions

View File

@@ -1,74 +0,0 @@
From: Jeff Mahoney <jeffm@suse.com>
Subject: autofs: use libldap_r instead of libldap for thread safety
References: bsc#955477
In order for OpenSSL to be threadsafe, CRYPTO_set_locking_callback needs
to be used to set the locking function. That's only done with libldap_r,
not plain libldap.
>From the openldap source:
** The preprocessor flag LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE
** can be used to determine if -lldap_r is available at compile
** time. You must define LDAP_THREAD_SAFE if and only if you
** link with -lldap_r.
**
** If you fail to define LDAP_THREAD_SAFE when linking with
** -lldap_r or define LDAP_THREAD_SAFE when linking with -lldap,
** provided header definations and declarations may be incorrect.
The autofs Makefile defines LDAP_THREAD_SAFE and then links with -lldap.
This patch links with -lldap_r instead and fixes observed crashes.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
aclocal.m4 | 8 ++++----
configure.in | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
Index: autofs-5.1.9/aclocal.m4
===================================================================
--- autofs-5.1.9.orig/aclocal.m4
+++ autofs-5.1.9/aclocal.m4
@@ -374,11 +374,11 @@ dnl
dnl Check for function ldap_create_page_control
dnl --------------------------------------------------------------------------
AC_DEFUN([AF_CHECK_FUNC_LDAP_CREATE_PAGE_CONTROL],
-[AC_MSG_CHECKING(for ldap_create_page_control in -lldap)
+[AC_MSG_CHECKING(for ldap_create_page_control in -lldap_r)
# save current libs
af_check_ldap_create_page_control_save_libs="$LIBS"
-LIBS="$LIBS -lldap"
+LIBS="$LIBS -lldap_r"
af_check_ldap_create_page_control_save_cflags="$CFLAGS"
CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
@@ -410,11 +410,11 @@ dnl
dnl Check for function ldap_parse_page_control
dnl --------------------------------------------------------------------------
AC_DEFUN([AF_CHECK_FUNC_LDAP_PARSE_PAGE_CONTROL],
-[AC_MSG_CHECKING(for ldap_parse_page_control in -lldap)
+[AC_MSG_CHECKING(for ldap_parse_page_control in -lldap_r)
# save current libs
af_check_ldap_parse_page_control_save_libs="$LIBS"
-LIBS="$LIBS -lldap"
+LIBS="$LIBS -lldap_r"
af_check_ldap_parse_page_control_save_cflags="$CFLAGS"
CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
Index: autofs-5.1.9/configure.ac
===================================================================
--- autofs-5.1.9.orig/configure.ac
+++ autofs-5.1.9/configure.ac
@@ -299,7 +299,7 @@ AC_ARG_WITH(openldap,
if test -z "$HAVE_LDAP" -o "$HAVE_LDAP" != "0"; then
HAVE_LDAP=0
LDAP_FLAGS="$LDAP_FLAGS -DLDAP_DEPRECATED=1"
- AC_CHECK_LIB(ldap, ldap_initialize, HAVE_LDAP=1 LIBLDAP="$LIBLDAP -lldap -llber -lresolv", ,
+ AC_CHECK_LIB(ldap_r, ldap_initialize, HAVE_LDAP=1 LIBLDAP="$LIBLDAP -lldap_r -llber -lresolv", ,
-llber -lresolv $LIBS)
if test "$HAVE_LDAP" = "1"; then
AC_DEFINE(WITH_LDAP,1,

View File

@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Thu Sep 18 01:31:04 UTC 2025 - David Disseldorp <ddiss@suse.com>
- Link against ldap.so instead of ldap_r.so; the former now provides
thread-safety and the latter is a symlink which may not exist
(bsc#1249966)
* drop autofs-use-libldap_r-instead-of-libldap-for-thread-safety.patch
-------------------------------------------------------------------
Wed Jul 16 20:29:16 UTC 2025 - David Disseldorp <ddiss@suse.com>

View File

@@ -53,8 +53,6 @@ Patch100: autofs-5.1.1-suse-auto_master_default.patch
Patch101: autofs-5.1.1-debuginfo-fix.patch
# PATCH-EXTEND-OPENSUSE autofs-dbus-udisks-monitor.patch
Patch102: autofs-5.1.1-dbus-udisks-monitor.patch
# PATCH-FIX-OPENSUSE autofs-use-libldap_r-instead-of-libldap-for-thread-safety.patch [bsc#955477]
Patch104: autofs-use-libldap_r-instead-of-libldap-for-thread-safety.patch
# bsc#1175238 - Use /usr/etc/nsswitch.conf if /etc/nsswitch.conf is not available
Patch106: autofs-nsswitch-usr-etc.patch
# bsc#1207881 - Obsolete and incorrect manual page details for autofs(8)
@@ -105,7 +103,6 @@ cp %{SOURCE5} .
%patch -P 100 -p1
%patch -P 101 -p1
%patch -P 102 -p1
%patch -P 104 -p1
%patch -P 106 -p1
%patch -P 108 -p1
%patch -P 109 -p1