Skip to contentSkip to conversation

Gentoo related patches

PATCH In review Ian Kent 2 participants 14 messages Jul 24, 2013

Subsystems (3)
lore
Share & tools
lore

Ian Kent

author maintainer
#0 lore raw

cover Gentoo related patches

Here is what I have so far for the recently posted Gentoo related patches and the older patch posted by Dustin.

Have a look and check I haven't made any stupid mistakes and that I've covered everything.

The patches not present should be covered by the unfinished patch, originally from Dustin.

---

Dustin Polke (1):
autofs-5.0.7 - fix compilation of lookup_ldap.c without sasl

Lan Yixun (dlan) (8):
autofs-5.0.7 - fix typo forced-shutdown should be force-shutdown autofs-5.0.7 - fix hesiod check error and use correct $(LIBS) setting autofs-5.0.7 - fix dead LDAP symbolic link when LDAP support is disabled autofs-5.0.7 - add missing libtirpc lib to mount_nfs.so when TIRPC enabled autofs-5.0.7 - use compiler determined by configure instead of hard-coded ones autofs-5.0.7 - remove hard-coded STRIP variable
autofs-5.0.7 - use LIBS for link libraries
autofs-5.0.7 - unbundle NOTSTRIP from DEBUG so they dont depend on each other

 CHANGELOG             |    9 +++++++++
 Makefile.conf.in      |    3 +++
 Makefile.rules        |   30 +++++++++++++++---------------
 aclocal.m4            |   12 ++++++------
 configure             |   20 ++++++++++----------
 configure.in          |    2 +-
 daemon/Makefile       |    2 +-
 include/lookup_ldap.h |    4 ++--
 lib/Makefile          |    4 ++++
 modules/Makefile      |   20 ++++++++++++--------
 modules/lookup_ldap.c |   14 ++++++++++++--
 11 files changed, 75 insertions(+), 45 deletions(-)
Signature · 1 line
Ian
author maintainer
#1 lore raw

PATCH 1/9 autofs-5.0.7 - fix typo forced-shutdown should be force-shutdown

From: Lan Yixun (dlan) <[email protected]>

This will confuse people when they find what shows with "./configure --help" is different from what is actually used.

Edited by: Ian Kent <[email protected]>
- make description a little more readable.
- update configure to include change.

---
 CHANGELOG    |    1 +
 configure    |    8 ++++----
 configure.in |    2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)
CHANGELOG +1 -0
index 3228d6b..5751805 100644
@@ -57,6 +57,7 @@
 - fix a couple of compiler warnings.
 - add after sssd dependency to unit file.
 - dont start readmap unless ready.
+- fix typo forced-shutdown should be force-shutdown.
 
 25/07/2012 autofs-5.0.7
 =======================
configure +4 -4
index 08b7ccc..e412734 100755
@@ -741,7 +741,7 @@ with_openldap
 with_sasl
 enable_ext_env
 enable_mount_locking
-enable_forced_shutdown
+enable_force_shutdown
 enable_ignore_busy
 '
       ac_precious_vars='build_alias
@@ -5553,9 +5553,9 @@ fi
 #
 # Enable forced shutdown on USR1 signal (unlink umounts all mounts).
 #
-# Check whether --enable-forced-shutdown was given.
-if test "${enable_forced_shutdown+set}" = set; then :
-  enableval=$enable_forced_shutdown;
+# Check whether --enable-force-shutdown was given.
+if test "${enable_force_shutdown+set}" = set; then :
+  enableval=$enable_force_shutdown;
 else
   enableval=no
 fi
configure.in +1 -1
index 559045a..0013a39 100644
@@ -363,7 +363,7 @@ fi
 #
 # Enable forced shutdown on USR1 signal (unlink umounts all mounts).
 #
-AC_ARG_ENABLE(forced-shutdown,
+AC_ARG_ENABLE(force-shutdown,
 [  --enable-force-shutdown enable USR1 signal to force unlink umount of any
 			  busy mounts during shutdown],,
 	enableval=no)
author maintainer
#2 lore raw

PATCH 2/9 autofs-5.0.7 - fix hesiod check error and use correct $(LIBS) setting

In reply to Ian Kent

From: Lan Yixun (dlan) <[email protected]>

the problem here is that hesiod checking always fail due to wrong $(LDFLAGS), no matter hesiod library is installed or not. moving "-lhesiod" into $(LIBS) solve this problem.

1) convert "char *" -> "void *" to fix the compile warning
2) put "-lhesiod -lresolv" into $(LIBS), not into $(LDFLAGS), otherwise we got link error

Edited by: Ian Kent <[email protected]>
- update configure to include change.

---
 CHANGELOG  |    1 +
 aclocal.m4 |   12 ++++++------
 configure  |   12 ++++++------
 3 files changed, 13 insertions(+), 12 deletions(-)
CHANGELOG +1 -0
index 5751805..3c829cf 100644
@@ -58,6 +58,7 @@
 - add after sssd dependency to unit file.
 - dont start readmap unless ready.
 - fix typo forced-shutdown should be force-shutdown.
+- fix hesiod check error and use correct $(LIBS) setting.
 
 25/07/2012 autofs-5.0.7
 =======================
aclocal.m4 +6 -6
index c5de159..110d106 100644
@@ -309,20 +309,20 @@ dnl --------------------------------------------------------------------------
 AC_DEFUN([AF_CHECK_LIBHESIOD],
 [AC_MSG_CHECKING(for libhesiod)
 
-# save current ldflags
-af_check_hesiod_save_ldflags="$LDFLAGS"
-LDFLAGS="$LDFLAGS -lhesiod -lresolv"
+# save current libs
+af_check_hesiod_save_libs="$LIBS"
+LIBS="$LIBS -lhesiod -lresolv"
 
 AC_TRY_LINK(
   [ #include <hesiod.h> ],
-  [ char *c; hesiod_init(&c); ],
+  [ void *c; hesiod_init(&c); ],
   [ HAVE_HESIOD=1
     LIBHESIOD="$LIBHESIOD -lhesiod -lresolv"
     AC_MSG_RESULT(yes) ],
   [ AC_MSG_RESULT(no) ])
 
-# restore ldflags
-LDFLAGS="$af_check_hesiod_save_ldflags"
+# restore libs
+LIBS="$af_check_hesiod_save_libs"
 ])
 
 dnl --------------------------------------------------------------------------
configure +6 -6
index e412734..3801e9d 100755
@@ -4221,9 +4221,9 @@ then
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libhesiod" >&5
 $as_echo_n "checking for libhesiod... " >&6; }
 
-# save current ldflags
-af_check_hesiod_save_ldflags="$LDFLAGS"
-LDFLAGS="$LDFLAGS -lhesiod -lresolv"
+# save current libs
+af_check_hesiod_save_libs="$LIBS"
+LIBS="$LIBS -lhesiod -lresolv"
 
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -4231,7 +4231,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 int
 main ()
 {
- char *c; hesiod_init(&c);
+ void *c; hesiod_init(&c);
   ;
   return 0;
 }
@@ -4248,8 +4248,8 @@ fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 
-# restore ldflags
-LDFLAGS="$af_check_hesiod_save_ldflags"
+# restore libs
+LIBS="$af_check_hesiod_save_libs"
 
 	if test "$HAVE_HESIOD" == "1"; then
 
author maintainer
#3 lore raw

PATCH 3/9 autofs-5.0.7 - fix dead LDAP symbolic link when LDAP support is disabled

In reply to Ian Kent

From: Lan Yixun (dlan) <[email protected]>

autofs will create symbol link mandatory no matter ldap support is enabled or not. so, without this patch, lookup_ldaps.so will become a dead link.

Edited by: Ian Kent <[email protected]>
- change check from SASL to LDAP since the ldaps lookup module may still be used by ldaps:// as long as LDAP support is built.

---
 CHANGELOG        |    1 +
 modules/Makefile |    2 ++
 2 files changed, 3 insertions(+)
CHANGELOG +1 -0
index 3c829cf..9755e25 100644
@@ -59,6 +59,7 @@
 - dont start readmap unless ready.
 - fix typo forced-shutdown should be force-shutdown.
 - fix hesiod check error and use correct $(LIBS) setting.
+- fix dead LDAP symbolic link when LDAP support is disabled.
 
 25/07/2012 autofs-5.0.7
 =======================
modules/Makefile +2 -0
index c5deb24..8c0df18 100644
@@ -74,7 +74,9 @@ install: all
 	-rm -f $(INSTALLROOT)$(autofslibdir)/mount_smbfs.so
 	ln -fs lookup_file.so $(INSTALLROOT)$(autofslibdir)/lookup_files.so
 	ln -fs lookup_yp.so $(INSTALLROOT)$(autofslibdir)/lookup_nis.so
+ifeq ($(LDAP), 1)
 	ln -fs lookup_ldap.so $(INSTALLROOT)$(autofslibdir)/lookup_ldaps.so
+endif
 	ln -fs mount_nfs.so $(INSTALLROOT)$(autofslibdir)/mount_nfs4.so
 ifeq ($(EXT2FS), 1)
  ifeq ($(EXT3FS), 1)
author maintainer
#4 lore raw

PATCH 4/9 autofs-5.0.7 - add missing libtirpc lib to mount_nfs.so when TIRPC enabled

In reply to Ian Kent

From: Lan Yixun (dlan) <[email protected]>

this is need when libtirpc is enabled, otherwise autofs fail to start due to it can't find symbol clnt_dg_create (which is provided by libtirpc)

autofs error log from /var/log/message:

Jul 23 12:11:58 ofire automount[25699]: open_mount:244: parse(sun): cannot open mount module
nfs (/usr/lib64/autofs/mount_nfs.so: undefined symbol: clnt_dg_create)
Jul 23 12:11:58 ofire automount[25699]: lookup(file): failed to open parse context

without this patch, mount_nfs.so fail link to libtirpc.so

 # ldd /usr/lib64/autofs/mount_nfs.so |grep tirpc

with this patch applied:

 # ldd /usr/lib64/autofs/mount_nfs.so |grep tirpc
        libtirpc.so.1 => /lib64/libtirpc.so.1 (0x00007f7d94920000)
---
 CHANGELOG        |    1 +
 modules/Makefile |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
CHANGELOG +1 -0
index 9755e25..72d9135 100644
@@ -60,6 +60,7 @@
 - fix typo forced-shutdown should be force-shutdown.
 - fix hesiod check error and use correct $(LIBS) setting.
 - fix dead LDAP symbolic link when LDAP support is disabled.
+- add missing libtirpc lib to mount_nfs.so when TIRPC enabled.
 
 25/07/2012 autofs-5.0.7
 =======================
modules/Makefile +1 -1
index 8c0df18..e61e338 100644
@@ -116,6 +116,6 @@ lookup_ldap.so: lookup_ldap.c dclist.o base64.o $(SASL_OBJ)
 
 mount_nfs.so: mount_nfs.c replicated.o
 	$(CC) $(SOLDFLAGS) $(CFLAGS) -o mount_nfs.so \
-		mount_nfs.c replicated.o $(AUTOFS_LIB) $(LIBNSL)
+		mount_nfs.c replicated.o $(AUTOFS_LIB) $(LIBNSL) $(TIRPCLIB)
 	$(STRIP) mount_nfs.so
 
author maintainer
#5 lore raw

PATCH 5/9 autofs-5.0.7 - use compiler determined by configure instead of hard-coded ones

In reply to Ian Kent

From: Lan Yixun (dlan) <[email protected]>

the logic here is:
if user pass compiler variable, then use it, otherwise fallback to default value

this will provide most flexibility, so user can set this variable it would be even useful for cross-compile environment.

---
 CHANGELOG        |    1 +
 Makefile.conf.in |    3 +++
 Makefile.rules   |    8 ++++----
 3 files changed, 8 insertions(+), 4 deletions(-)
CHANGELOG +1 -0
index 72d9135..ebabf21 100644
@@ -61,6 +61,7 @@
 - fix hesiod check error and use correct $(LIBS) setting.
 - fix dead LDAP symbolic link when LDAP support is disabled.
 - add missing libtirpc lib to mount_nfs.so when TIRPC enabled.
+- use compiler determined by configure instead of hard-coded ones.
 
 25/07/2012 autofs-5.0.7
 =======================
Makefile.conf.in +3 -0
index 3766d45..cb53e66 100644
@@ -109,3 +109,6 @@ initdir = @initdir@
 
 # Location of systemd unit files
 systemddir = @systemddir@
+
+# Use the compiler determined by configure instead of hard-coded ones
+CC := @CC@
Makefile.rules +4 -4
index 6b5b2bd..9aebd19 100644
@@ -38,10 +38,10 @@ STRIP     = strip --strip-debug
 endif
 endif
 
-CC        = gcc
-CXX       = g++
-CXXFLAGS  = $(CFLAGS)
-LD        = ld
+CC        ?= gcc
+CXX       ?= g++
+CXXFLAGS  ?= $(CFLAGS)
+LD        ?= ld
 SOLDFLAGS = -shared
 
 CFLAGS += -D_REENTRANT -D_FILE_OFFSET_BITS=64
#6 lore raw

Re: [PATCH 5/9] autofs-5.0.7 - use compiler determined by configure instead of hard-coded ones

Quoted 48 lines · Ian Kent

From: Lan Yixun (dlan) <[email protected]>

the logic here is:
if user pass compiler variable, then use it, otherwise fallback to default value

this will provide most flexibility, so user can set this variable it would be even useful for cross-compile environment.

---
 CHANGELOG        |    1 +
 Makefile.conf.in |    3 +++
 Makefile.rules   |    8 ++++----
 3 files changed, 8 insertions(+), 4 deletions(-)
CHANGELOG +1 -0
index 72d9135..ebabf21 100644
@@ -61,6 +61,7 @@
 - fix hesiod check error and use correct $(LIBS) setting.
 - fix dead LDAP symbolic link when LDAP support is disabled.
 - add missing libtirpc lib to mount_nfs.so when TIRPC enabled.
+- use compiler determined by configure instead of hard-coded ones.
 
 25/07/2012 autofs-5.0.7
 =======================
Makefile.conf.in +3 -0
index 3766d45..cb53e66 100644
@@ -109,3 +109,6 @@ initdir = @initdir@
 
 # Location of systemd unit files
 systemddir = @systemddir@
+
+# Use the compiler determined by configure instead of hard-coded ones
+CC := @CC@
Makefile.rules +0 -1
index 6b5b2bd..9aebd19 100644
@@ -38,10 +38,10 @@ STRIP     = strip --strip-debug
 endif
 endif
 
-CC        = gcc

Makefile.rules STRIP = strip --strip-debug · line 47

Quoted 10 lines
Makefile.rules +4 -3
-CXX       = g++
-CXXFLAGS  = $(CFLAGS)
-LD        = ld
+CC        ?= gcc
+CXX       ?= g++
+CXXFLAGS  ?= $(CFLAGS)
+LD        ?= ld
 SOLDFLAGS = -shared
 
 CFLAGS += -D_REENTRANT -D_FILE_OFFSET_BITS=64

HI Ian:
Missed the changes for "LDFLAGS"?also need to change from " =" to " ?= "

but it's strange that you seems correct in
[PATCH 6/9] autofs-5.0.7 - remove hard-coded STRIP variable

 LDFLAGS   ?= -g      --> correct
-STRIP     = :
+STRIP     ?= :
 else
 ifdef DONTSTRIP
 CFLAGS    ?= -O2 -g
 LDFLAGS   ?= -g        --> correct
-STRIP     = :
+STRIP     ?= :

else
CFLAGS ?= -O2 -Wall
LDFLAGS ?= -s --> correct

author maintainer
#7 lore raw

Re: [PATCH 5/9] autofs-5.0.7 - use compiler determined by configure instead of hard-coded ones

Quoted 57 lines · Dennis Lan (dlan)
Quoted 56 lines · Ian Kent

From: Lan Yixun (dlan) <[email protected]>

the logic here is:
if user pass compiler variable, then use it, otherwise fallback to default value

this will provide most flexibility, so user can set this variable it would be even useful for cross-compile environment.

---
 CHANGELOG        |    1 +
 Makefile.conf.in |    3 +++
 Makefile.rules   |    8 ++++----
 3 files changed, 8 insertions(+), 4 deletions(-)
CHANGELOG +1 -0
index 72d9135..ebabf21 100644
@@ -61,6 +61,7 @@
 - fix hesiod check error and use correct $(LIBS) setting.
 - fix dead LDAP symbolic link when LDAP support is disabled.
 - add missing libtirpc lib to mount_nfs.so when TIRPC enabled.
+- use compiler determined by configure instead of hard-coded ones.
 
 25/07/2012 autofs-5.0.7
 =======================
Makefile.conf.in +3 -0
index 3766d45..cb53e66 100644
@@ -109,3 +109,6 @@ initdir = @initdir@
 
 # Location of systemd unit files
 systemddir = @systemddir@
+
+# Use the compiler determined by configure instead of hard-coded ones
+CC := @CC@
Makefile.rules +4 -4
index 6b5b2bd..9aebd19 100644
@@ -38,10 +38,10 @@ STRIP     = strip --strip-debug
 endif
 endif
 
-CC        = gcc
-CXX       = g++
-CXXFLAGS  = $(CFLAGS)
-LD        = ld
+CC        ?= gcc
+CXX       ?= g++
+CXXFLAGS  ?= $(CFLAGS)
+LD        ?= ld
 SOLDFLAGS = -shared
 
Quoted 8 lines

Makefile.rules STRIP = strip --strip-debug · line 47

Quoted 2 lines
Makefile.rules +0 -0
 CFLAGS += -D_REENTRANT -D_FILE_OFFSET_BITS=64

HI Ian:
Missed the changes for "LDFLAGS"?also need to change from " =" to " ?= "

but it's strange that you seems correct in
[PATCH 6/9] autofs-5.0.7 - remove hard-coded STRIP variable

I have another patch in the queue which already changes this. Thought I mentioned that in an edit note in the relevant patch ....

Quoted 13 lines

LDFLAGS ?= -g --> correct

(quoted diff) +2 -2
-STRIP     = :
+STRIP     ?= :
 else
 ifdef DONTSTRIP
 CFLAGS    ?= -O2 -g
 LDFLAGS   ?= -g        --> correct
-STRIP     = :
+STRIP     ?= :
 else
 CFLAGS    ?= -O2 -Wall
 LDFLAGS   ?= -s       --> correct
author maintainer
#8 lore raw

PATCH 6/9 autofs-5.0.7 - remove hard-coded STRIP variable

In reply to Ian Kent

From: Lan Yixun (dlan) <[email protected]>

according to autoconf manual[1], build script should allow user override the CFLAGS, LDFLAGS varible (passed via ./configure). And actually, we should not directly use CFLAGS, LDFLAGS, but have to create another one (eg. AUTOFS_CFLAGS). FYI, see section "Variable: CFLAGS", the last paragraph.

Here, I slightly modify the code so that we can still fallback to the default one.

[1] http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Preset-Output-Variables.html#Preset-Output-Variables

Edited by: Ian Kent <[email protected]>
- allow for previous LDFLAGS patch.
- rename patch to reflect what's actually done but leave the original description in place as a reminder.

---
 CHANGELOG      |    1 +
 Makefile.rules |    6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)
CHANGELOG +1 -0
index ebabf21..a0af868 100644
@@ -62,6 +62,7 @@
 - fix dead LDAP symbolic link when LDAP support is disabled.
 - add missing libtirpc lib to mount_nfs.so when TIRPC enabled.
 - use compiler determined by configure instead of hard-coded ones.
+- remove hard-coded STRIP variable.
 
 25/07/2012 autofs-5.0.7
 =======================
Makefile.rules +3 -3
index 9aebd19..d00ba3c 100644
@@ -25,16 +25,16 @@ endif
 ifdef DEBUG
 CFLAGS    ?= -g -Wall -DDEBUG
 LDFLAGS   ?= -g
-STRIP     = :
+STRIP     ?= :
 else
 ifdef DONTSTRIP
 CFLAGS    ?= -O2 -g
 LDFLAGS   ?= -g
-STRIP     = :
+STRIP     ?= :
 else
 CFLAGS    ?= -O2 -Wall
 LDFLAGS   ?= -s
-STRIP     = strip --strip-debug
+STRIP     ?= strip --strip-debug
 endif
 endif
 
author maintainer
#9 lore raw

PATCH 7/9 autofs-5.0.7 - use LIBS for link libraries

In reply to Ian Kent

From: Lan Yixun (dlan) <[email protected]>

quote:
"Don't use this variable to pass library names (-l) to the linker; use LIBS instead."

see the section "Variable: LDFLAGS" in:
http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/PreseOutput-Variables.html#Preset-Output-Variables

Edited by: Ian Kent <[email protected]>
The variable usage changes for LDFLAGS and LIBS appear to be dependent on each other so merge them to try and avoid breakage if not all are used by someone. I also had changed the patch titles slightly when I imported them but they should be easily recognisable.
- merge patches
- pthread-link-library-should-be-put-into-LIBS-not-LDFLAGS
- library-should-be-passed-via-variable-LIBS-not-LDFLAGS
- accumulate-LIBS-variable-changes-otherwise-we-may-lose-early-settings
- allow-user-to-pass-LDFLAGS-via-configure
- add LIBS to build rules, might fix DMALLOC build problem

---
 CHANGELOG        |    1 +
 Makefile.rules   |   10 ++++++----
 daemon/Makefile  |    2 +-
 modules/Makefile |   12 ++++++------
 4 files changed, 14 insertions(+), 11 deletions(-)
CHANGELOG +1 -0
index a0af868..897a2b4 100644
@@ -63,6 +63,7 @@
 - add missing libtirpc lib to mount_nfs.so when TIRPC enabled.
 - use compiler determined by configure instead of hard-coded ones.
 - remove hard-coded STRIP variable.
+- use LIBS for link libraries.
 
 25/07/2012 autofs-5.0.7
 =======================
Makefile.rules +6 -4
index d00ba3c..fa53459 100644
@@ -45,17 +45,19 @@ LD        ?= ld
 SOLDFLAGS = -shared
 
 CFLAGS += -D_REENTRANT -D_FILE_OFFSET_BITS=64
-LDFLAGS += -lpthread
+LIBS += -lpthread
 
 ifdef TIRPCLIB
 CFLAGS += -I/usr/include/tirpc
-LDFLAGS += $(TIRPCLIB)
+LIBS += $(TIRPCLIB)
 endif
 
 ifdef DMALLOCLIB
-LDFLAGS += $(DMALLOCLIB)
+LIBS += $(DMALLOCLIB)
 endif
 
+LIBS += $(LIBNSL)
+
 # Standard rules
 
 .SUFFIXES: .c .o .s .so
@@ -67,5 +69,5 @@ endif
 	$(CC) $(CFLAGS) -S $<
 
 .c.so:
-	$(CC) $(SOLDFLAGS) $(CFLAGS) -o $*.so $< $(AUTOFS_LIB) $(DMALLOCLIB) $(LIBNSL)
+	$(CC) $(LDFLAGS) $(SOLDFLAGS) $(CFLAGS) -o $*.so $< $(AUTOFS_LIB) $(LIBS)
 	$(STRIP) $*.so
daemon/Makefile +1 -1
index 9e9d635..6604c9a 100644
@@ -20,7 +20,7 @@ CFLAGS += -DAUTOFS_FIFO_DIR=\"$(autofsfifodir)\"
 CFLAGS += -DAUTOFS_FLAG_DIR=\"$(autofsflagdir)\"
 CFLAGS += -DVERSION_STRING=\"$(version)\"
 LDFLAGS += -rdynamic
-LIBS = -ldl
+LIBS += -ldl
 
 ifeq ($(LDAP), 1)
     CFLAGS += $(XML_FLAGS)
modules/Makefile +6 -6
index e61e338..de01ebd 100644
@@ -98,8 +98,8 @@ endif
 # Ad hoc compilation rules for modules which need auxilliary libraries
 #
 lookup_hesiod.so: lookup_hesiod.c
-	$(CC) $(SOLDFLAGS) $(CFLAGS) $(HESIOD_FLAGS) -o lookup_hesiod.so \
-		lookup_hesiod.c $(AUTOFS_LIB) $(LIBHESIOD) $(LIBRESOLV)
+	$(CC) $(LDFLAGS) $(SOLDFLAGS) $(CFLAGS) $(HESIOD_FLAGS) -o lookup_hesiod.so \
+		lookup_hesiod.c $(AUTOFS_LIB) $(LIBHESIOD) $(LIBRESOLV) $(LIBS)
 	$(STRIP) lookup_hesiod.so
 
 cyrus-sasl.o: cyrus-sasl.c
@@ -109,13 +109,13 @@ cyrus-sasl-extern.o: cyrus-sasl-extern.c
 	$(CC) $(CFLAGS) $(LDAP_FLAGS) -c $<
 
 lookup_ldap.so: lookup_ldap.c dclist.o base64.o $(SASL_OBJ)
-	$(CC) $(SOLDFLAGS) $(CFLAGS) $(LDAP_FLAGS) -o lookup_ldap.so \
+	$(CC) $(LDFLAGS) $(SOLDFLAGS) $(CFLAGS) $(LDAP_FLAGS) -o lookup_ldap.so \
 		lookup_ldap.c dclist.o base64.o $(SASL_OBJ) \
-		$(AUTOFS_LIB) $(LIBLDAP) $(LIBRESOLV)
+		$(AUTOFS_LIB) $(LIBLDAP) $(LIBRESOLV) $(LIBS)
 	$(STRIP) lookup_ldap.so
 
 mount_nfs.so: mount_nfs.c replicated.o
-	$(CC) $(SOLDFLAGS) $(CFLAGS) -o mount_nfs.so \
-		mount_nfs.c replicated.o $(AUTOFS_LIB) $(LIBNSL) $(TIRPCLIB)
+	$(CC) $(LDFLAGS) $(SOLDFLAGS) $(CFLAGS) -o mount_nfs.so \
+		mount_nfs.c replicated.o $(AUTOFS_LIB) $(LIBS)
 	$(STRIP) mount_nfs.so
 
author maintainer
#10 lore raw

PATCH 8/9 autofs-5.0.7 - unbundle NOTSTRIP from DEBUG so they dont depend on each other

In reply to Ian Kent

From: Lan Yixun (dlan) <[email protected]>

Gentoo build system expects unstripped elf image from the build system, seperate this, will allow us to better control the strip operation.

---
 CHANGELOG      |    1 +
 Makefile.rules |   10 ++++------
 2 files changed, 5 insertions(+), 6 deletions(-)
CHANGELOG +1 -0
index 897a2b4..42ea627 100644
@@ -64,6 +64,7 @@
 - use compiler determined by configure instead of hard-coded ones.
 - remove hard-coded STRIP variable.
 - use LIBS for link libraries.
+- unbundle NOTSTRIP from DEBUG so they dont depend on each other.
 
 25/07/2012 autofs-5.0.7
 =======================
Makefile.rules +4 -6
index fa53459..0754a00 100644
@@ -25,18 +25,16 @@ endif
 ifdef DEBUG
 CFLAGS    ?= -g -Wall -DDEBUG
 LDFLAGS   ?= -g
-STRIP     ?= :
 else
+CFLAGS    ?= -O2 -Wall
+LDFLAGS   ?= -s
+endif
+
 ifdef DONTSTRIP
-CFLAGS    ?= -O2 -g
-LDFLAGS   ?= -g
 STRIP     ?= :
 else
-CFLAGS    ?= -O2 -Wall
-LDFLAGS   ?= -s
 STRIP     ?= strip --strip-debug
 endif
-endif
 
 CC        ?= gcc
 CXX       ?= g++
author maintainer
#11 lore raw

PATCH 9/9 autofs-5.0.7 - fix compilation of lookup_ldap.c without sasl

In reply to Ian Kent

From: Dustin Polke <[email protected]>

See https://bugs.gentoo.org/show_bug.cgi?id=361899 for more info.

Edited by: Ian Kent <[email protected]>
- fix parse_ldap_config() is needed by ldap but previously excluded.
- exclude other references to ctxt->extern_cert and ctxt->extern_key.
- prevent memory leak if present in config but not used.
- remove now unused set_env().

---
 CHANGELOG             |    1 +
 include/lookup_ldap.h |    4 ++--
 lib/Makefile          |    4 ++++
 modules/Makefile      |    6 ++++--
 modules/lookup_ldap.c |   14 ++++++++++++--
 5 files changed, 23 insertions(+), 6 deletions(-)
CHANGELOG +1 -0
index 42ea627..63d5aac 100644
@@ -65,6 +65,7 @@
 - remove hard-coded STRIP variable.
 - use LIBS for link libraries.
 - unbundle NOTSTRIP from DEBUG so they dont depend on each other.
+- fix compilation of lookup_ldap.c without sasl.
 
 25/07/2012 autofs-5.0.7
 =======================
include/lookup_ldap.h +2 -2
index 9a4ce73..f34c029 100644
@@ -11,6 +11,8 @@
 #include <krb5.h>
 #endif
 
+#include <libxml/tree.h>
+
 #include "list.h"
 #include "dclist.h"
 
@@ -92,7 +94,6 @@ struct lookup_context {
 };
 
 
-#ifdef WITH_SASL
 #define LDAP_AUTH_CONF_FILE "test"
 
 #define LDAP_TLS_DONT_USE	0
@@ -104,7 +105,6 @@ struct lookup_context {
 #define LDAP_AUTH_REQUIRED	0x0002
 #define LDAP_AUTH_AUTODETECT	0x0004
 #define LDAP_NEED_AUTH		(LDAP_AUTH_REQUIRED|LDAP_AUTH_AUTODETECT)
-#endif
 
 #define LDAP_AUTH_USESIMPLE	0x0008
 
lib/Makefile +4 -0
index 5418009..4a5b712 100644
@@ -24,6 +24,10 @@ CFLAGS += -I../include -fPIC -D_GNU_SOURCE
 CFLAGS += -DAUTOFS_MAP_DIR=\"$(autofsmapdir)\"
 CFLAGS += -DAUTOFS_CONF_DIR=\"$(autofsconfdir)\"
 
+ifeq ($(LDAP), 1)
+  CFLAGS += $(XML_FLAGS) $(XML_LIBS)
+endif
+
 .PHONY: all install clean
 
 all: autofs.a
modules/Makefile +4 -2
index de01ebd..8610783 100644
@@ -45,10 +45,12 @@ endif
 ifeq ($(LDAP), 1)
   SRCS += lookup_ldap.c
   MODS += lookup_ldap.so
+  LDAP_FLAGS += $(XML_FLAGS) -DLDAP_THREAD_SAFE
+  LIBLDAP += $(XML_LIBS)
   ifeq ($(SASL), 1)
     SASL_OBJ = cyrus-sasl.o cyrus-sasl-extern.o
-    LDAP_FLAGS += $(SASL_FLAGS) $(XML_FLAGS) $(KRB5_FLAGS) -DLDAP_THREAD_SAFE
-    LIBLDAP += $(LIBSASL) $(XML_LIBS) $(KRB5_LIBS)
+    LDAP_FLAGS += $(SASL_FLAGS) $(KRB5_FLAGS)
+    LIBLDAP += $(LIBSASL) $(KRB5_LIBS)
   endif
 endif
 
modules/lookup_ldap.c +12 -2
index a2bfafd..904cc21 100644
@@ -66,6 +66,7 @@ struct ldap_search_params {
 
 static int decode_percent_hack(const char *, char **);
 
+#ifdef HAVE_SASL
 static int set_env(unsigned logopt, const char *name, const char *val)
 {
 	int ret = setenv(name, val, 1);
@@ -75,6 +76,7 @@ static int set_env(unsigned logopt, const char *name, const char *val)
 	}
 	return 1;
 }
+#endif
 
 #ifndef HAVE_LDAP_CREATE_PAGE_CONTROL
 int ldap_create_page_control(LDAP *ldap, ber_int_t pagesize,
@@ -585,10 +587,12 @@ static LDAP *do_connect(unsigned logopt, const char *uri, struct lookup_context
 {
 	LDAP *ldap;
 
+#ifdef HAVE_SASL
 	if (ctxt->extern_cert && ctxt->extern_key) {
 		set_env(logopt, ENV_LDAPTLS_CERT, ctxt->extern_cert);
 		set_env(logopt, ENV_LDAPTLS_KEY, ctxt->extern_key);
 	}
+#endif
 
 	ldap = init_ldap_connection(logopt, uri, ctxt);
 	if (ldap) {
@@ -791,7 +795,6 @@ find_server:
 	return ldap;
 }
 
-#ifdef WITH_SASL
 int get_property(unsigned logopt, xmlNodePtr node, const char *prop, char **value)
 {
 	xmlChar *ret;
@@ -812,6 +815,7 @@ int get_property(unsigned logopt, xmlNodePtr node, const char *prop, char **valu
 	return 0;
 }
 
+#ifdef WITH_SASL
 /*
  *  For plain text, login and digest-md5 authentication types, we need
  *  user and password credentials.
@@ -824,6 +828,7 @@ int authtype_requires_creds(const char *authtype)
 		return 1;
 	return 0;
 }
+#endif
 
 /*
  *  Returns:
@@ -1056,6 +1061,7 @@ auth_fail:
 		}
 	} else if (auth_required == LDAP_AUTH_REQUIRED &&
 		  (authtype && !strncmp(authtype, "EXTERNAL", 8))) {
+#ifdef WITH_SASL
 		ret = get_property(logopt, root, "external_cert",  &extern_cert);
 		ret |= get_property(logopt, root, "external_key",  &extern_key);
 		/*
@@ -1074,6 +1080,7 @@ auth_fail:
 			if (extern_key)
 				free(extern_key);
 		}
+#endif
 	}
 
 	/*
@@ -1094,8 +1101,10 @@ auth_fail:
 	ctxt->secret = secret;
 	ctxt->client_princ = client_princ;
 	ctxt->client_cc = client_cc;
+#ifdef WITH_SASL
 	ctxt->extern_cert = extern_cert;
 	ctxt->extern_key = extern_key;
+#endif
 
 	debug(logopt, MODPREFIX
 	      "ldap authentication configured with the following options:");
@@ -1127,7 +1136,6 @@ out:
 
 	return ret;
 }
-#endif
 
 /*
  *  Take an input string as specified in the master map, and break it
@@ -1390,10 +1398,12 @@ static void free_context(struct lookup_context *ctxt)
 		defaults_free_searchdns(ctxt->sdns);
 	if (ctxt->dclist)
 		free_dclist(ctxt->dclist);
+#ifdef HAVE_SASL
 	if (ctxt->extern_cert)
 		free(ctxt->extern_cert);
 	if (ctxt->extern_key)
 		free(ctxt->extern_key);
+#endif
 	free(ctxt);
 
 	return;
#12 lore raw

Re: [PATCH 9/9] autofs-5.0.7 - fix compilation of lookup_ldap.c without sasl

Quoted 97 lines · Ian Kent

From: Dustin Polke <[email protected]>

See https://bugs.gentoo.org/show_bug.cgi?id=361899 for more info.

Edited by: Ian Kent <[email protected]>
- fix parse_ldap_config() is needed by ldap but previously excluded.
- exclude other references to ctxt->extern_cert and ctxt->extern_key.
- prevent memory leak if present in config but not used.
- remove now unused set_env().

---
 CHANGELOG             |    1 +
 include/lookup_ldap.h |    4 ++--
 lib/Makefile          |    4 ++++
 modules/Makefile      |    6 ++++--
 modules/lookup_ldap.c |   14 ++++++++++++--
 5 files changed, 23 insertions(+), 6 deletions(-)
CHANGELOG +1 -0
index 42ea627..63d5aac 100644
@@ -65,6 +65,7 @@
 - remove hard-coded STRIP variable.
 - use LIBS for link libraries.
 - unbundle NOTSTRIP from DEBUG so they dont depend on each other.
+- fix compilation of lookup_ldap.c without sasl.
 
 25/07/2012 autofs-5.0.7
 =======================
include/lookup_ldap.h +2 -2
index 9a4ce73..f34c029 100644
@@ -11,6 +11,8 @@
 #include <krb5.h>
 #endif
 
+#include <libxml/tree.h>
+
 #include "list.h"
 #include "dclist.h"
 
@@ -92,7 +94,6 @@ struct lookup_context {
 };
 
 
-#ifdef WITH_SASL
 #define LDAP_AUTH_CONF_FILE "test"
 
 #define LDAP_TLS_DONT_USE      0
@@ -104,7 +105,6 @@ struct lookup_context {
 #define LDAP_AUTH_REQUIRED     0x0002
 #define LDAP_AUTH_AUTODETECT   0x0004
 #define LDAP_NEED_AUTH         (LDAP_AUTH_REQUIRED|LDAP_AUTH_AUTODETECT)
-#endif
 
 #define LDAP_AUTH_USESIMPLE    0x0008
 
lib/Makefile +4 -0
index 5418009..4a5b712 100644
@@ -24,6 +24,10 @@ CFLAGS += -I../include -fPIC -D_GNU_SOURCE
 CFLAGS += -DAUTOFS_MAP_DIR=\"$(autofsmapdir)\"
 CFLAGS += -DAUTOFS_CONF_DIR=\"$(autofsconfdir)\"
 
+ifeq ($(LDAP), 1)
+  CFLAGS += $(XML_FLAGS) $(XML_LIBS)
+endif
+
 .PHONY: all install clean
 
 all: autofs.a
modules/Makefile +4 -2
index de01ebd..8610783 100644
@@ -45,10 +45,12 @@ endif
 ifeq ($(LDAP), 1)
   SRCS += lookup_ldap.c
   MODS += lookup_ldap.so
+  LDAP_FLAGS += $(XML_FLAGS) -DLDAP_THREAD_SAFE
+  LIBLDAP += $(XML_LIBS)
   ifeq ($(SASL), 1)
     SASL_OBJ = cyrus-sasl.o cyrus-sasl-extern.o
-    LDAP_FLAGS += $(SASL_FLAGS) $(XML_FLAGS) $(KRB5_FLAGS) -DLDAP_THREAD_SAFE
-    LIBLDAP += $(LIBSASL) $(XML_LIBS) $(KRB5_LIBS)
+    LDAP_FLAGS += $(SASL_FLAGS) $(KRB5_FLAGS)
+    LIBLDAP += $(LIBSASL) $(KRB5_LIBS)
   endif
 endif
 
modules/lookup_ldap.c +0 -0
index a2bfafd..904cc21 100644

modules/lookup_ldap.c struct ldap_search_params { · line 69

Quoted 4 lines
modules/lookup_ldap.c +1 -0
@@ -66,6 +66,7 @@ struct ldap_search_params {
 
 static int decode_percent_hack(const char *, char **);
 
+#ifdef HAVE_SASL

As I checked file of include/config.h (generated by ./configure) there is only "WITH_SASL", but no "HAVE_SASL"

Quoted 12 lines
modules/lookup_ldap.c +1 -0
 static int set_env(unsigned logopt, const char *name, const char *val)
 {
        int ret = setenv(name, val, 1);
@@ -75,6 +76,7 @@ static int set_env(unsigned logopt, const char *name, const char *val)
        }
        return 1;
 }
+#endif
 
 #ifndef HAVE_LDAP_CREATE_PAGE_CONTROL
 int ldap_create_page_control(LDAP *ldap, ber_int_t pagesize,

modules/lookup_ldap.c static LDAP *do_connect(unsigned logopt, const char *uri, struct lookup_context · line 590

Quoted 4 lines
modules/lookup_ldap.c +1 -0
@@ -585,10 +587,12 @@ static LDAP *do_connect(unsigned logopt, const char *uri, struct lookup_context
 {
        LDAP *ldap;
 
+#ifdef HAVE_SASL

same here

Quoted 68 lines
modules/lookup_ldap.c +7 -2
        if (ctxt->extern_cert && ctxt->extern_key) {
                set_env(logopt, ENV_LDAPTLS_CERT, ctxt->extern_cert);
                set_env(logopt, ENV_LDAPTLS_KEY, ctxt->extern_key);
        }
+#endif
 
        ldap = init_ldap_connection(logopt, uri, ctxt);
        if (ldap) {
@@ -791,7 +795,6 @@ find_server:
        return ldap;
 }
 
-#ifdef WITH_SASL
 int get_property(unsigned logopt, xmlNodePtr node, const char *prop, char **value)
 {
        xmlChar *ret;
@@ -812,6 +815,7 @@ int get_property(unsigned logopt, xmlNodePtr node, const char *prop, char **valu
        return 0;
 }
 
+#ifdef WITH_SASL
 /*
  *  For plain text, login and digest-md5 authentication types, we need
  *  user and password credentials.
@@ -824,6 +828,7 @@ int authtype_requires_creds(const char *authtype)
                return 1;
        return 0;
 }
+#endif
 
 /*
  *  Returns:
@@ -1056,6 +1061,7 @@ auth_fail:
                }
        } else if (auth_required == LDAP_AUTH_REQUIRED &&
                  (authtype && !strncmp(authtype, "EXTERNAL", 8))) {
+#ifdef WITH_SASL
                ret = get_property(logopt, root, "external_cert",  &extern_cert);
                ret |= get_property(logopt, root, "external_key",  &extern_key);
                /*
@@ -1074,6 +1080,7 @@ auth_fail:
                        if (extern_key)
                                free(extern_key);
                }
+#endif
        }
 
        /*
@@ -1094,8 +1101,10 @@ auth_fail:
        ctxt->secret = secret;
        ctxt->client_princ = client_princ;
        ctxt->client_cc = client_cc;
+#ifdef WITH_SASL
        ctxt->extern_cert = extern_cert;
        ctxt->extern_key = extern_key;
+#endif
 
        debug(logopt, MODPREFIX
              "ldap authentication configured with the following options:");
@@ -1127,7 +1136,6 @@ out:
 
        return ret;
 }
-#endif
 
 /*
  *  Take an input string as specified in the master map, and break it

modules/lookup_ldap.c static void free_context(struct lookup_context *ctxt) · line 1401

Quoted 4 lines
modules/lookup_ldap.c +1 -0
@@ -1390,10 +1398,12 @@ static void free_context(struct lookup_context *ctxt)
                defaults_free_searchdns(ctxt->sdns);
        if (ctxt->dclist)
                free_dclist(ctxt->dclist);
+#ifdef HAVE_SASL

same here

Quoted 9 lines
modules/lookup_ldap.c +1 -0
        if (ctxt->extern_cert)
                free(ctxt->extern_cert);
        if (ctxt->extern_key)
                free(ctxt->extern_key);
+#endif
        free(ctxt);
 
        return;
author maintainer
#13 lore raw

Re: [PATCH 9/9] autofs-5.0.7 - fix compilation of lookup_ldap.c without sasl

Quoted 99 lines · Dennis Lan (dlan)
Quoted 98 lines · Ian Kent

From: Dustin Polke <[email protected]>

See https://bugs.gentoo.org/show_bug.cgi?id=361899 for more info.

Edited by: Ian Kent <[email protected]>
- fix parse_ldap_config() is needed by ldap but previously excluded.
- exclude other references to ctxt->extern_cert and ctxt->extern_key.
- prevent memory leak if present in config but not used.
- remove now unused set_env().

---
 CHANGELOG             |    1 +
 include/lookup_ldap.h |    4 ++--
 lib/Makefile          |    4 ++++
 modules/Makefile      |    6 ++++--
 modules/lookup_ldap.c |   14 ++++++++++++--
 5 files changed, 23 insertions(+), 6 deletions(-)
CHANGELOG +1 -0
index 42ea627..63d5aac 100644
@@ -65,6 +65,7 @@
 - remove hard-coded STRIP variable.
 - use LIBS for link libraries.
 - unbundle NOTSTRIP from DEBUG so they dont depend on each other.
+- fix compilation of lookup_ldap.c without sasl.
 
 25/07/2012 autofs-5.0.7
 =======================
include/lookup_ldap.h +2 -2
index 9a4ce73..f34c029 100644
@@ -11,6 +11,8 @@
 #include <krb5.h>
 #endif
 
+#include <libxml/tree.h>
+
 #include "list.h"
 #include "dclist.h"
 
@@ -92,7 +94,6 @@ struct lookup_context {
 };
 
 
-#ifdef WITH_SASL
 #define LDAP_AUTH_CONF_FILE "test"
 
 #define LDAP_TLS_DONT_USE      0
@@ -104,7 +105,6 @@ struct lookup_context {
 #define LDAP_AUTH_REQUIRED     0x0002
 #define LDAP_AUTH_AUTODETECT   0x0004
 #define LDAP_NEED_AUTH         (LDAP_AUTH_REQUIRED|LDAP_AUTH_AUTODETECT)
-#endif
 
 #define LDAP_AUTH_USESIMPLE    0x0008
 
lib/Makefile +4 -0
index 5418009..4a5b712 100644
@@ -24,6 +24,10 @@ CFLAGS += -I../include -fPIC -D_GNU_SOURCE
 CFLAGS += -DAUTOFS_MAP_DIR=\"$(autofsmapdir)\"
 CFLAGS += -DAUTOFS_CONF_DIR=\"$(autofsconfdir)\"
 
+ifeq ($(LDAP), 1)
+  CFLAGS += $(XML_FLAGS) $(XML_LIBS)
+endif
+
 .PHONY: all install clean
 
 all: autofs.a
modules/Makefile +4 -2
index de01ebd..8610783 100644
@@ -45,10 +45,12 @@ endif
 ifeq ($(LDAP), 1)
   SRCS += lookup_ldap.c
   MODS += lookup_ldap.so
+  LDAP_FLAGS += $(XML_FLAGS) -DLDAP_THREAD_SAFE
+  LIBLDAP += $(XML_LIBS)
   ifeq ($(SASL), 1)
     SASL_OBJ = cyrus-sasl.o cyrus-sasl-extern.o
-    LDAP_FLAGS += $(SASL_FLAGS) $(XML_FLAGS) $(KRB5_FLAGS) -DLDAP_THREAD_SAFE
-    LIBLDAP += $(LIBSASL) $(XML_LIBS) $(KRB5_LIBS)
+    LDAP_FLAGS += $(SASL_FLAGS) $(KRB5_FLAGS)
+    LIBLDAP += $(LIBSASL) $(KRB5_LIBS)
   endif
 endif
 
modules/lookup_ldap.c +0 -0
index a2bfafd..904cc21 100644
@@ -66,6 +66,7 @@ struct ldap_search_params {
 
Quoted 5 lines

modules/lookup_ldap.c struct ldap_search_params { · line 69

Quoted 3 lines
modules/lookup_ldap.c +1 -0
 static int decode_percent_hack(const char *, char **);
 
+#ifdef HAVE_SASL

As I checked file of include/config.h (generated by ./configure) there is only "WITH_SASL", but no "HAVE_SASL"

Right, thanks for mentioning it, I'll check that when I work though this patch. I haven't actually looked closely at it since I moved to to "will commit" status, and it definitely needs to be reviewed.

Quoted 103 lines
Quoted 14 lines
modules/lookup_ldap.c +1 -0
 static int set_env(unsigned logopt, const char *name, const char *val)
 {
        int ret = setenv(name, val, 1);
@@ -75,6 +76,7 @@ static int set_env(unsigned logopt, const char *name, const char *val)
        }
        return 1;
 }
+#endif
 
 #ifndef HAVE_LDAP_CREATE_PAGE_CONTROL
 int ldap_create_page_control(LDAP *ldap, ber_int_t pagesize,

modules/lookup_ldap.c static LDAP *do_connect(unsigned logopt, const char *uri, struct lookup_context · line 590

Quoted 4 lines
modules/lookup_ldap.c +1 -0
@@ -585,10 +587,12 @@ static LDAP *do_connect(unsigned logopt, const char *uri, struct lookup_context
 {
        LDAP *ldap;
 
+#ifdef HAVE_SASL

same here

Quoted 68 lines
modules/lookup_ldap.c +7 -2
        if (ctxt->extern_cert && ctxt->extern_key) {
                set_env(logopt, ENV_LDAPTLS_CERT, ctxt->extern_cert);
                set_env(logopt, ENV_LDAPTLS_KEY, ctxt->extern_key);
        }
+#endif
 
        ldap = init_ldap_connection(logopt, uri, ctxt);
        if (ldap) {
@@ -791,7 +795,6 @@ find_server:
        return ldap;
 }
 
-#ifdef WITH_SASL
 int get_property(unsigned logopt, xmlNodePtr node, const char *prop, char **value)
 {
        xmlChar *ret;
@@ -812,6 +815,7 @@ int get_property(unsigned logopt, xmlNodePtr node, const char *prop, char **valu
        return 0;
 }
 
+#ifdef WITH_SASL
 /*
  *  For plain text, login and digest-md5 authentication types, we need
  *  user and password credentials.
@@ -824,6 +828,7 @@ int authtype_requires_creds(const char *authtype)
                return 1;
        return 0;
 }
+#endif
 
 /*
  *  Returns:
@@ -1056,6 +1061,7 @@ auth_fail:
                }
        } else if (auth_required == LDAP_AUTH_REQUIRED &&
                  (authtype && !strncmp(authtype, "EXTERNAL", 8))) {
+#ifdef WITH_SASL
                ret = get_property(logopt, root, "external_cert",  &extern_cert);
                ret |= get_property(logopt, root, "external_key",  &extern_key);
                /*
@@ -1074,6 +1080,7 @@ auth_fail:
                        if (extern_key)
                                free(extern_key);
                }
+#endif
        }
 
        /*
@@ -1094,8 +1101,10 @@ auth_fail:
        ctxt->secret = secret;
        ctxt->client_princ = client_princ;
        ctxt->client_cc = client_cc;
+#ifdef WITH_SASL
        ctxt->extern_cert = extern_cert;
        ctxt->extern_key = extern_key;
+#endif
 
        debug(logopt, MODPREFIX
              "ldap authentication configured with the following options:");
@@ -1127,7 +1136,6 @@ out:
 
        return ret;
 }
-#endif
 
 /*
  *  Take an input string as specified in the master map, and break it

modules/lookup_ldap.c static void free_context(struct lookup_context *ctxt) · line 1401

Quoted 4 lines
modules/lookup_ldap.c +1 -0
@@ -1390,10 +1398,12 @@ static void free_context(struct lookup_context *ctxt)
                defaults_free_searchdns(ctxt->sdns);
        if (ctxt->dclist)
                free_dclist(ctxt->dclist);
+#ifdef HAVE_SASL

same here

Quoted 9 lines
modules/lookup_ldap.c +1 -0
        if (ctxt->extern_cert)
                free(ctxt->extern_cert);
        if (ctxt->extern_key)
                free(ctxt->extern_key);
+#endif
        free(ctxt);
 
        return;