1 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
4 changed files with 20 additions and 82 deletions

View File

@@ -587,14 +587,13 @@ Index: autofs-5.1.9/modules/Makefile
===================================================================
--- autofs-5.1.9.orig/modules/Makefile
+++ autofs-5.1.9/modules/Makefile
@@ -62,6 +62,14 @@ ifeq ($(SSSD), 1)
@@ -62,6 +62,13 @@ ifeq ($(SSSD), 1)
MODS += lookup_sss.so
endif
+ifeq ($(UDISKS), 1)
+ UDISKS_FLAGS += $(shell pkg-config --cflags dbus-1)
+ UDISKS_LIBS += $(shell pkg-config --libs dbus-1)
+ UDISKS_LIBS += $(AUTOFS_LIB)
+ SRCS += lookup_udisks.c
+ MODS += lookup_udisks.so
+endif
@@ -602,12 +601,13 @@ Index: autofs-5.1.9/modules/Makefile
CFLAGS += -I../include -I../lib -fPIC -D_GNU_SOURCE
CFLAGS += -DAUTOFS_LIB_DIR=\"$(autofslibdir)\"
CFLAGS += -DAUTOFS_MAP_DIR=\"$(autofsmapdir)\"
@@ -145,6 +153,10 @@ lookup_ldap.so: lookup_ldap.c dclist.o b
@@ -145,6 +152,11 @@ lookup_ldap.so: lookup_ldap.c dclist.o b
$(LDFLAGS) $(LIBLDAP) $(LIBRESOLV) $(LIBS) $(AUTOFS_LIB_LINK)
$(STRIP) lookup_ldap.so
+lookup_udisks.so: lookup_udisks.c ../include/lookup_udisks.h
+ $(CC) $(SOLDFLAGS) $(CFLAGS) $(UDISKS_FLAGS) -o $@ $< $(UDISKS_LIBS)
+ $(CC) $(SOLDFLAGS) $(CFLAGS) $(UDISKS_FLAGS) -o $@ $< \
+ $(LDFLAGS) $(UDISKS_LIBS) $(LIBS) $(AUTOFS_LIB_LINK)
+ $(STRIP) $@
+
mount_nfs.so: mount_nfs.c replicated.o

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,18 @@
-------------------------------------------------------------------
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>
- 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
-------------------------------------------------------------------
Tue Jan 14 18:14:14 UTC 2025 - Goldwyn Rodrigues <rgoldwyn@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package autofs
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -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