* [PATCH 0/9] Gentoo related patches
@ 2013-07-24 8:52 Ian Kent
2013-07-24 8:53 ` [PATCH 1/9] autofs-5.0.7 - fix typo forced-shutdown should be force-shutdown Ian Kent
` (8 more replies)
0 siblings, 9 replies; 14+ messages in thread
From: Ian Kent @ 2013-07-24 8:52 UTC (permalink / raw)
To: Lan Yixun (dlan); +Cc: autofs mailing list
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(-)
--
Ian
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/9] autofs-5.0.7 - fix typo forced-shutdown should be force-shutdown
2013-07-24 8:52 [PATCH 0/9] Gentoo related patches Ian Kent
@ 2013-07-24 8:53 ` Ian Kent
2013-07-24 8:53 ` [PATCH 2/9] autofs-5.0.7 - fix hesiod check error and use correct $(LIBS) setting Ian Kent
` (7 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Ian Kent @ 2013-07-24 8:53 UTC (permalink / raw)
To: Lan Yixun (dlan); +Cc: autofs mailing list
From: Lan Yixun (dlan) <dennis.yxun@gmail.com>
This will confuse people when they find what shows with "./configure --help"
is different from what is actually used.
Edited by: Ian Kent <raven@themaw.net>
- make description a little more readable.
- update configure to include change.
Signed-off-by: Lan Yixun (dlan) <dennis.yxun@gmail.com>
---
CHANGELOG | 1 +
configure | 8 ++++----
configure.in | 2 +-
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index 3228d6b..5751805 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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
=======================
diff --git a/configure b/configure
index 08b7ccc..e412734 100755
--- a/configure
+++ b/configure
@@ -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
diff --git a/configure.in b/configure.in
index 559045a..0013a39 100644
--- a/configure.in
+++ b/configure.in
@@ -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)
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 2/9] autofs-5.0.7 - fix hesiod check error and use correct $(LIBS) setting
2013-07-24 8:52 [PATCH 0/9] Gentoo related patches Ian Kent
2013-07-24 8:53 ` [PATCH 1/9] autofs-5.0.7 - fix typo forced-shutdown should be force-shutdown Ian Kent
@ 2013-07-24 8:53 ` Ian Kent
2013-07-24 8:53 ` [PATCH 3/9] autofs-5.0.7 - fix dead LDAP symbolic link when LDAP support is disabled Ian Kent
` (6 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Ian Kent @ 2013-07-24 8:53 UTC (permalink / raw)
To: Lan Yixun (dlan); +Cc: autofs mailing list
From: Lan Yixun (dlan) <dennis.yxun@gmail.com>
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 <raven@themaw.net>
- update configure to include change.
---
CHANGELOG | 1 +
aclocal.m4 | 12 ++++++------
configure | 12 ++++++------
3 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index 5751805..3c829cf 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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
=======================
diff --git a/aclocal.m4 b/aclocal.m4
index c5de159..110d106 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -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 --------------------------------------------------------------------------
diff --git a/configure b/configure
index e412734..3801e9d 100755
--- a/configure
+++ b/configure
@@ -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
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 3/9] autofs-5.0.7 - fix dead LDAP symbolic link when LDAP support is disabled
2013-07-24 8:52 [PATCH 0/9] Gentoo related patches Ian Kent
2013-07-24 8:53 ` [PATCH 1/9] autofs-5.0.7 - fix typo forced-shutdown should be force-shutdown Ian Kent
2013-07-24 8:53 ` [PATCH 2/9] autofs-5.0.7 - fix hesiod check error and use correct $(LIBS) setting Ian Kent
@ 2013-07-24 8:53 ` Ian Kent
2013-07-24 8:53 ` [PATCH 4/9] autofs-5.0.7 - add missing libtirpc lib to mount_nfs.so when TIRPC enabled Ian Kent
` (5 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Ian Kent @ 2013-07-24 8:53 UTC (permalink / raw)
To: Lan Yixun (dlan); +Cc: autofs mailing list
From: Lan Yixun (dlan) <dennis.yxun@gmail.com>
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 <raven@themaw.net>
- 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(+)
diff --git a/CHANGELOG b/CHANGELOG
index 3c829cf..9755e25 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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
=======================
diff --git a/modules/Makefile b/modules/Makefile
index c5deb24..8c0df18 100644
--- a/modules/Makefile
+++ b/modules/Makefile
@@ -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)
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 4/9] autofs-5.0.7 - add missing libtirpc lib to mount_nfs.so when TIRPC enabled
2013-07-24 8:52 [PATCH 0/9] Gentoo related patches Ian Kent
` (2 preceding siblings ...)
2013-07-24 8:53 ` [PATCH 3/9] autofs-5.0.7 - fix dead LDAP symbolic link when LDAP support is disabled Ian Kent
@ 2013-07-24 8:53 ` Ian Kent
2013-07-24 8:53 ` [PATCH 5/9] autofs-5.0.7 - use compiler determined by configure instead of hard-coded ones Ian Kent
` (4 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Ian Kent @ 2013-07-24 8:53 UTC (permalink / raw)
To: Lan Yixun (dlan); +Cc: autofs mailing list
From: Lan Yixun (dlan) <dennis.yxun@gmail.com>
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)
Signed-off-by: Lan Yixun (dlan) <dennis.yxun@gmail.com>
---
CHANGELOG | 1 +
modules/Makefile | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG b/CHANGELOG
index 9755e25..72d9135 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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
=======================
diff --git a/modules/Makefile b/modules/Makefile
index 8c0df18..e61e338 100644
--- a/modules/Makefile
+++ b/modules/Makefile
@@ -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
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 5/9] autofs-5.0.7 - use compiler determined by configure instead of hard-coded ones
2013-07-24 8:52 [PATCH 0/9] Gentoo related patches Ian Kent
` (3 preceding siblings ...)
2013-07-24 8:53 ` [PATCH 4/9] autofs-5.0.7 - add missing libtirpc lib to mount_nfs.so when TIRPC enabled Ian Kent
@ 2013-07-24 8:53 ` Ian Kent
2013-07-24 9:45 ` Dennis Lan (dlan)
2013-07-24 8:53 ` [PATCH 6/9] autofs-5.0.7 - remove hard-coded STRIP variable Ian Kent
` (3 subsequent siblings)
8 siblings, 1 reply; 14+ messages in thread
From: Ian Kent @ 2013-07-24 8:53 UTC (permalink / raw)
To: Lan Yixun (dlan); +Cc: autofs mailing list
From: Lan Yixun (dlan) <dennis.yxun@gmail.com>
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.
Signed-off-by: Lan Yixun (dlan) <dennis.yxun@gmail.com>
---
CHANGELOG | 1 +
Makefile.conf.in | 3 +++
Makefile.rules | 8 ++++----
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index 72d9135..ebabf21 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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
=======================
diff --git a/Makefile.conf.in b/Makefile.conf.in
index 3766d45..cb53e66 100644
--- a/Makefile.conf.in
+++ b/Makefile.conf.in
@@ -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@
diff --git a/Makefile.rules b/Makefile.rules
index 6b5b2bd..9aebd19 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -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
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 6/9] autofs-5.0.7 - remove hard-coded STRIP variable
2013-07-24 8:52 [PATCH 0/9] Gentoo related patches Ian Kent
` (4 preceding siblings ...)
2013-07-24 8:53 ` [PATCH 5/9] autofs-5.0.7 - use compiler determined by configure instead of hard-coded ones Ian Kent
@ 2013-07-24 8:53 ` Ian Kent
2013-07-24 8:53 ` [PATCH 7/9] autofs-5.0.7 - use LIBS for link libraries Ian Kent
` (2 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Ian Kent @ 2013-07-24 8:53 UTC (permalink / raw)
To: Lan Yixun (dlan); +Cc: autofs mailing list
From: Lan Yixun (dlan) <dennis.yxun@gmail.com>
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 <raven@themaw.net>
- allow for previous LDFLAGS patch.
- rename patch to reflect what's actually done but leave the original
description in place as a reminder.
Signed-off-by: Lan Yixun (dlan) <dennis.yxun@gmail.com>
---
CHANGELOG | 1 +
Makefile.rules | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index ebabf21..a0af868 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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
=======================
diff --git a/Makefile.rules b/Makefile.rules
index 9aebd19..d00ba3c 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -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
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 7/9] autofs-5.0.7 - use LIBS for link libraries
2013-07-24 8:52 [PATCH 0/9] Gentoo related patches Ian Kent
` (5 preceding siblings ...)
2013-07-24 8:53 ` [PATCH 6/9] autofs-5.0.7 - remove hard-coded STRIP variable Ian Kent
@ 2013-07-24 8:53 ` Ian Kent
2013-07-24 8:53 ` [PATCH 8/9] autofs-5.0.7 - unbundle NOTSTRIP from DEBUG so they dont depend on each other Ian Kent
2013-07-24 8:54 ` [PATCH 9/9] autofs-5.0.7 - fix compilation of lookup_ldap.c without sasl Ian Kent
8 siblings, 0 replies; 14+ messages in thread
From: Ian Kent @ 2013-07-24 8:53 UTC (permalink / raw)
To: Lan Yixun (dlan); +Cc: autofs mailing list
From: Lan Yixun (dlan) <dennis.yxun@gmail.com>
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 <raven@themaw.net>
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
Signed-off-by: Lan Yixun (dlan) <dennis.yxun@gmail.com>
---
CHANGELOG | 1 +
Makefile.rules | 10 ++++++----
daemon/Makefile | 2 +-
modules/Makefile | 12 ++++++------
4 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index a0af868..897a2b4 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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
=======================
diff --git a/Makefile.rules b/Makefile.rules
index d00ba3c..fa53459 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -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
diff --git a/daemon/Makefile b/daemon/Makefile
index 9e9d635..6604c9a 100644
--- a/daemon/Makefile
+++ b/daemon/Makefile
@@ -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)
diff --git a/modules/Makefile b/modules/Makefile
index e61e338..de01ebd 100644
--- a/modules/Makefile
+++ b/modules/Makefile
@@ -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
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 8/9] autofs-5.0.7 - unbundle NOTSTRIP from DEBUG so they dont depend on each other
2013-07-24 8:52 [PATCH 0/9] Gentoo related patches Ian Kent
` (6 preceding siblings ...)
2013-07-24 8:53 ` [PATCH 7/9] autofs-5.0.7 - use LIBS for link libraries Ian Kent
@ 2013-07-24 8:53 ` Ian Kent
2013-07-24 8:54 ` [PATCH 9/9] autofs-5.0.7 - fix compilation of lookup_ldap.c without sasl Ian Kent
8 siblings, 0 replies; 14+ messages in thread
From: Ian Kent @ 2013-07-24 8:53 UTC (permalink / raw)
To: Lan Yixun (dlan); +Cc: autofs mailing list
From: Lan Yixun (dlan) <dennis.yxun@gmail.com>
Gentoo build system expects unstripped elf image from the build system,
seperate this, will allow us to better control the strip operation.
Signed-off-by: Lan Yixun (dlan) <dennis.yxun@gmail.com>
---
CHANGELOG | 1 +
Makefile.rules | 10 ++++------
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index 897a2b4..42ea627 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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
=======================
diff --git a/Makefile.rules b/Makefile.rules
index fa53459..0754a00 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -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++
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 9/9] autofs-5.0.7 - fix compilation of lookup_ldap.c without sasl
2013-07-24 8:52 [PATCH 0/9] Gentoo related patches Ian Kent
` (7 preceding siblings ...)
2013-07-24 8:53 ` [PATCH 8/9] autofs-5.0.7 - unbundle NOTSTRIP from DEBUG so they dont depend on each other Ian Kent
@ 2013-07-24 8:54 ` Ian Kent
2013-07-24 9:53 ` Dennis Lan (dlan)
8 siblings, 1 reply; 14+ messages in thread
From: Ian Kent @ 2013-07-24 8:54 UTC (permalink / raw)
To: Lan Yixun (dlan); +Cc: autofs mailing list
From: Dustin Polke <DuPol@gmx.de>
See https://bugs.gentoo.org/show_bug.cgi?id=361899 for more info.
Edited by: Ian Kent <raven@themaw.net>
- 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(-)
diff --git a/CHANGELOG b/CHANGELOG
index 42ea627..63d5aac 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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
=======================
diff --git a/include/lookup_ldap.h b/include/lookup_ldap.h
index 9a4ce73..f34c029 100644
--- a/include/lookup_ldap.h
+++ b/include/lookup_ldap.h
@@ -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
diff --git a/lib/Makefile b/lib/Makefile
index 5418009..4a5b712 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -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
diff --git a/modules/Makefile b/modules/Makefile
index de01ebd..8610783 100644
--- a/modules/Makefile
+++ b/modules/Makefile
@@ -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
diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c
index a2bfafd..904cc21 100644
--- a/modules/lookup_ldap.c
+++ b/modules/lookup_ldap.c
@@ -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;
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH 5/9] autofs-5.0.7 - use compiler determined by configure instead of hard-coded ones
2013-07-24 8:53 ` [PATCH 5/9] autofs-5.0.7 - use compiler determined by configure instead of hard-coded ones Ian Kent
@ 2013-07-24 9:45 ` Dennis Lan (dlan)
2013-07-24 10:16 ` Ian Kent
0 siblings, 1 reply; 14+ messages in thread
From: Dennis Lan (dlan) @ 2013-07-24 9:45 UTC (permalink / raw)
To: Ian Kent; +Cc: autofs mailing list
On Wed, Jul 24, 2013 at 4:53 PM, Ian Kent <raven@themaw.net> wrote:
> From: Lan Yixun (dlan) <dennis.yxun@gmail.com>
>
> 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.
>
> Signed-off-by: Lan Yixun (dlan) <dennis.yxun@gmail.com>
> ---
> CHANGELOG | 1 +
> Makefile.conf.in | 3 +++
> Makefile.rules | 8 ++++----
> 3 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/CHANGELOG b/CHANGELOG
> index 72d9135..ebabf21 100644
> --- a/CHANGELOG
> +++ b/CHANGELOG
> @@ -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
> =======================
> diff --git a/Makefile.conf.in b/Makefile.conf.in
> index 3766d45..cb53e66 100644
> --- a/Makefile.conf.in
> +++ b/Makefile.conf.in
> @@ -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@
> diff --git a/Makefile.rules b/Makefile.rules
> index 6b5b2bd..9aebd19 100644
> --- a/Makefile.rules
> +++ b/Makefile.rules
> @@ -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
>
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
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 9/9] autofs-5.0.7 - fix compilation of lookup_ldap.c without sasl
2013-07-24 8:54 ` [PATCH 9/9] autofs-5.0.7 - fix compilation of lookup_ldap.c without sasl Ian Kent
@ 2013-07-24 9:53 ` Dennis Lan (dlan)
2013-07-24 10:20 ` Ian Kent
0 siblings, 1 reply; 14+ messages in thread
From: Dennis Lan (dlan) @ 2013-07-24 9:53 UTC (permalink / raw)
To: Ian Kent; +Cc: autofs mailing list
On Wed, Jul 24, 2013 at 4:54 PM, Ian Kent <raven@themaw.net> wrote:
> From: Dustin Polke <DuPol@gmx.de>
>
> See https://bugs.gentoo.org/show_bug.cgi?id=361899 for more info.
>
> Edited by: Ian Kent <raven@themaw.net>
> - 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(-)
>
> diff --git a/CHANGELOG b/CHANGELOG
> index 42ea627..63d5aac 100644
> --- a/CHANGELOG
> +++ b/CHANGELOG
> @@ -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
> =======================
> diff --git a/include/lookup_ldap.h b/include/lookup_ldap.h
> index 9a4ce73..f34c029 100644
> --- a/include/lookup_ldap.h
> +++ b/include/lookup_ldap.h
> @@ -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
>
> diff --git a/lib/Makefile b/lib/Makefile
> index 5418009..4a5b712 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -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
> diff --git a/modules/Makefile b/modules/Makefile
> index de01ebd..8610783 100644
> --- a/modules/Makefile
> +++ b/modules/Makefile
> @@ -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
>
> diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c
> index a2bfafd..904cc21 100644
> --- a/modules/lookup_ldap.c
> +++ b/modules/lookup_ldap.c
> @@ -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"
> 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
same here
> 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
same here
> if (ctxt->extern_cert)
> free(ctxt->extern_cert);
> if (ctxt->extern_key)
> free(ctxt->extern_key);
> +#endif
> free(ctxt);
>
> return;
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 5/9] autofs-5.0.7 - use compiler determined by configure instead of hard-coded ones
2013-07-24 9:45 ` Dennis Lan (dlan)
@ 2013-07-24 10:16 ` Ian Kent
0 siblings, 0 replies; 14+ messages in thread
From: Ian Kent @ 2013-07-24 10:16 UTC (permalink / raw)
To: Dennis Lan (dlan); +Cc: autofs mailing list
On Wed, 2013-07-24 at 17:45 +0800, Dennis Lan (dlan) wrote:
> On Wed, Jul 24, 2013 at 4:53 PM, Ian Kent <raven@themaw.net> wrote:
> > From: Lan Yixun (dlan) <dennis.yxun@gmail.com>
> >
> > 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.
> >
> > Signed-off-by: Lan Yixun (dlan) <dennis.yxun@gmail.com>
> > ---
> > CHANGELOG | 1 +
> > Makefile.conf.in | 3 +++
> > Makefile.rules | 8 ++++----
> > 3 files changed, 8 insertions(+), 4 deletions(-)
> >
> > diff --git a/CHANGELOG b/CHANGELOG
> > index 72d9135..ebabf21 100644
> > --- a/CHANGELOG
> > +++ b/CHANGELOG
> > @@ -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
> > =======================
> > diff --git a/Makefile.conf.in b/Makefile.conf.in
> > index 3766d45..cb53e66 100644
> > --- a/Makefile.conf.in
> > +++ b/Makefile.conf.in
> > @@ -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@
> > diff --git a/Makefile.rules b/Makefile.rules
> > index 6b5b2bd..9aebd19 100644
> > --- a/Makefile.rules
> > +++ b/Makefile.rules
> > @@ -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
> >
>
> 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 ....
>
> LDFLAGS ?= -g --> correct
> -STRIP = :
> +STRIP ?= :
> else
> ifdef DONTSTRIP
> CFLAGS ?= -O2 -g
> LDFLAGS ?= -g --> correct
> -STRIP = :
> +STRIP ?= :
> else
> CFLAGS ?= -O2 -Wall
> LDFLAGS ?= -s --> correct
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 9/9] autofs-5.0.7 - fix compilation of lookup_ldap.c without sasl
2013-07-24 9:53 ` Dennis Lan (dlan)
@ 2013-07-24 10:20 ` Ian Kent
0 siblings, 0 replies; 14+ messages in thread
From: Ian Kent @ 2013-07-24 10:20 UTC (permalink / raw)
To: Dennis Lan (dlan); +Cc: autofs mailing list
On Wed, 2013-07-24 at 17:53 +0800, Dennis Lan (dlan) wrote:
> On Wed, Jul 24, 2013 at 4:54 PM, Ian Kent <raven@themaw.net> wrote:
> > From: Dustin Polke <DuPol@gmx.de>
> >
> > See https://bugs.gentoo.org/show_bug.cgi?id=361899 for more info.
> >
> > Edited by: Ian Kent <raven@themaw.net>
> > - 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(-)
> >
> > diff --git a/CHANGELOG b/CHANGELOG
> > index 42ea627..63d5aac 100644
> > --- a/CHANGELOG
> > +++ b/CHANGELOG
> > @@ -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
> > =======================
> > diff --git a/include/lookup_ldap.h b/include/lookup_ldap.h
> > index 9a4ce73..f34c029 100644
> > --- a/include/lookup_ldap.h
> > +++ b/include/lookup_ldap.h
> > @@ -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
> >
> > diff --git a/lib/Makefile b/lib/Makefile
> > index 5418009..4a5b712 100644
> > --- a/lib/Makefile
> > +++ b/lib/Makefile
> > @@ -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
> > diff --git a/modules/Makefile b/modules/Makefile
> > index de01ebd..8610783 100644
> > --- a/modules/Makefile
> > +++ b/modules/Makefile
> > @@ -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
> >
> > diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c
> > index a2bfafd..904cc21 100644
> > --- a/modules/lookup_ldap.c
> > +++ b/modules/lookup_ldap.c
> > @@ -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"
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.
>
>
> > 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
> same here
>
> > 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
> same here
>
> > if (ctxt->extern_cert)
> > free(ctxt->extern_cert);
> > if (ctxt->extern_key)
> > free(ctxt->extern_key);
> > +#endif
> > free(ctxt);
> >
> > return;
> >
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2013-07-24 10:20 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-24 8:52 [PATCH 0/9] Gentoo related patches Ian Kent
2013-07-24 8:53 ` [PATCH 1/9] autofs-5.0.7 - fix typo forced-shutdown should be force-shutdown Ian Kent
2013-07-24 8:53 ` [PATCH 2/9] autofs-5.0.7 - fix hesiod check error and use correct $(LIBS) setting Ian Kent
2013-07-24 8:53 ` [PATCH 3/9] autofs-5.0.7 - fix dead LDAP symbolic link when LDAP support is disabled Ian Kent
2013-07-24 8:53 ` [PATCH 4/9] autofs-5.0.7 - add missing libtirpc lib to mount_nfs.so when TIRPC enabled Ian Kent
2013-07-24 8:53 ` [PATCH 5/9] autofs-5.0.7 - use compiler determined by configure instead of hard-coded ones Ian Kent
2013-07-24 9:45 ` Dennis Lan (dlan)
2013-07-24 10:16 ` Ian Kent
2013-07-24 8:53 ` [PATCH 6/9] autofs-5.0.7 - remove hard-coded STRIP variable Ian Kent
2013-07-24 8:53 ` [PATCH 7/9] autofs-5.0.7 - use LIBS for link libraries Ian Kent
2013-07-24 8:53 ` [PATCH 8/9] autofs-5.0.7 - unbundle NOTSTRIP from DEBUG so they dont depend on each other Ian Kent
2013-07-24 8:54 ` [PATCH 9/9] autofs-5.0.7 - fix compilation of lookup_ldap.c without sasl Ian Kent
2013-07-24 9:53 ` Dennis Lan (dlan)
2013-07-24 10:20 ` Ian Kent
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.