-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sasldir and plugindir in Makefile.am #339
Comments
From: Dilyan Palauzov cyrus-sasl-2.1.23/Makefile.am defines plugindir as Likewise plugins/Makefile.am defines sasldir = Motivation: when building on 64bit, libdir is /usr/lib64, prefix is /usr and I want to install the plugins in /usr/lib64/sasl2 <=> |
From: Jeroen van Meeuwen (Kolab Systems) I would actually say the plugins may need to go into /usr/libexec/, what do you think? |
From: Dilyan Palauzov About plugindir under /usr/libexec: Keep in mind, that on mixed 32/64 bit systems you need distinct plugin binaries for 32 and 64 bit code, and the best way to manage this is with two different directories. libexec is not mentioned in the Filesystem Hierarchy Standard. I think libexec is just for executables that are not invoked by the users, the libsasl2 plugins are not executables. That is why I consider libexec as supoptimal in this case. Apart from this, http://cyrusimap.org/docs/cyrus-sasl/2.1.23/sysadmin.php#saslconf says that the sasl2 application configuration files are checked (only) in /usr/lib/sasl2 and does not mention /etc/sasl2 . According to the NEWS file bug #2796 as of cyrus sasl 2.1.22 the /etc/sasl2 directory is searched as well (and I think this is much better so, in order to avoid configuration files in /usr/lib/sasl2 or /usr/lib64/sasl2 , depending on the 32/64bits of the application). |
From: Jeroen van Meeuwen (Kolab Systems) (In reply to comment #2) Just like with {,/usr}/{,s}bin/, a mixed architecture system on a single / shared root filesystem is cumbersome at best. /usr/sbin for example is not to be shared between a x86_64 and ppc64 simultaneously either (think GFS(2) over iSCSI, or NFS root filesystem). Likewise, the 32/64 bit doesn't pose a problem for plugins being located in /usr/libexec/. Should the plugins be moved, I suppose one would want to avoid moving them to another libdir and pay dynamic linker overhead whereas the plugins are dlopen()'ed (iirc). |
Attachment-Id: 1567 Patch to allow multiarch placement of plugins, based on distrib bundle |
From: Jan Parcel In the distributed 2.1.26, I was having trouble configuring plugindir and On Solaris systems, the install path and search path are different. For So I had to patch configure.in to create a --with-sasldir option, and I have attached my patch, which is NOT a code patch from your viewpoint, but If the fixes that are decided upon allow our library design to be configurable |
sasl installs the plugins in $prefix/lib/sasl2, which defaults to /usr/local/lib/sasl2, but looks for them in $plugindir, which defaults to /usr/lib/sasl2 . So "./configure && make install" does not work. This patch:
--- a/Makefile.am
+++ b/Makefile.am
@@ -83,24 +83,6 @@ dist-hook:
(cd $(distdir)/plugins && sh makeinit.sh)
framedir = /Library/Frameworks/SASL2.framework
-install-exec-local: $(INSTALLOSX)
- @if test "$(plugindir)" != "$(prefix)/lib/sasl2"; then \
- echo "********************************************************"; \
- echo "* WARNING:"; \
- echo "* Plugins are being installed into $(prefix)/lib/sasl2,"; \
- echo "* but the library will look for them in $(plugindir)."; \
- echo "* You need to make sure that the plugins will eventually"; \
- echo "* be in $(plugindir) -- the easiest way is to make a"; \
- echo "* symbolic link from $(plugindir) to $(prefix)/lib/sasl2,"; \
- echo "* but this may not be appropriate for your site, so this"; \
- echo "* installation procedure won't do it for you."; \
- echo "*"; \
- echo "* If you don't want to do this for some reason, you can"; \
- echo "* set the location where the library will look for plugins"; \
- echo "* by setting the environment variable SASL_PATH to the path"; \
- echo "* the library should use."; \
- echo "********************************************************"; \
- fi
install-exec-local-osx:
$(mkinstalldirs) $(framedir)/Versions/A/Headers
$(mkinstalldirs) $(framedir)/Versions/A/Resources
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1121,17 +1121,15 @@ AC_SUBST(SASL_STATIC_OBJS)
AC_SUBST(SASL_STATIC_LIBS)
AC_ARG_WITH(plugindir, [ --with-plugindir=DIR set the directory where plugins will
- be found [[/usr/lib/sasl2]] ],
+ be found [[LIBDIR/sasl2]] ],
plugindir=$withval,
- plugindir=/usr/lib/sasl2)
-AC_DEFINE_UNQUOTED(PLUGINDIR, "$plugindir", [Runtime plugin location])
+ plugindir='${libdir}'/sasl2)
AC_SUBST(plugindir)
AC_ARG_WITH(configdir, [ --with-configdir=DIR set the directory where config files will
- be found [/usr/lib/sasl2] ],
+ be found [PLUGINDIR:SYSCONFDIR/sasl2] ],
configdir=$withval,
- configdir=$plugindir:/etc/sasl2)
-AC_DEFINE_UNQUOTED(CONFIGDIR, "$configdir", [Runtime config file location])
+ configdir='${plugindir}:${sysconfdir}/sasl2')
AC_SUBST(configdir)
dnl look for rc4 libraries. we accept the CMU one or one from openSSL
diff --git a/lib/Makefile.am b/lib/Makefile.am
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -45,7 +45,7 @@
# CURRENT:REVISION:AGE
sasl_version = 3:0:0
-AM_CPPFLAGS=-DLIBSASL_EXPORTS=1 -I$(top_srcdir)/include -I$(top_srcdir)/plugins -I$(top_builddir)/include -I$(top_srcdir)/sasldb
+AM_CPPFLAGS=-DLIBSASL_EXPORTS=1 -I$(top_srcdir)/include -I$(top_srcdir)/plugins -I$(top_builddir)/include -I$(top_srcdir)/sasldb -DCONFIGDIR='"${configdir}"' -DPLUGINDIR='"${plugindir}"'
EXTRA_DIST = windlopen.c dlopen.c staticopen.h NTMakefile
EXTRA_LIBRARIES = libsasl2.a
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -63,8 +63,8 @@ plugindir = @plugindir@
common_sources = plugin_common.c plugin_common.h
-sasldir = $(prefix)/lib/sasl2
-sasl_LTLIBRARIES = @SASL_MECHS@
+
+plugin_LTLIBRARIES = @SASL_MECHS@
EXTRA_LTLIBRARIES = libplain.la libanonymous.la libkerberos4.la libcrammd5.la \
libgs2.la libgssapiv2.la libdigestmd5.la liblogin.la libsrp.la libotp.la \
libscram.la libntlm.la libpassdss.la libsasldb.la libsql.la libldapdb.la
diff --git a/sample/Makefile.am b/sample/Makefile.am
--- a/sample/Makefile.am
+++ b/sample/Makefile.am
@@ -42,7 +42,7 @@
#
################################################################
-AM_CPPFLAGS=-I$(top_srcdir)/include
+AM_CPPFLAGS=-I$(top_srcdir)/include -DPLUGINDIR='"${plugindir}"'
noinst_PROGRAMS = client server
EXTRA_PROGRAMS = sample-client sample-server
diff --git a/utils/Makefile.am b/utils/Makefile.am
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -89,7 +89,7 @@ libsfsasl2_la_SOURCES =
libsfsasl2_la_LIBADD = sfsasl.lo
libsfsasl2_la_LDFLAGS = -version-info 1:0:0 -export-dynamic -rpath $(libdir)
-AM_CPPFLAGS=-I$(top_srcdir)/include -I$(top_builddir)/include @SASL_DB_INC@
+AM_CPPFLAGS=-I$(top_srcdir)/include -I$(top_builddir)/include @SASL_DB_INC@ -DPLUGINDIR='"${plugindir}"'
EXTRA_DIST = saslpasswd2.8 sasldblistusers2.8 pluginviewer.8 sfsasl.h sfsasl.c smtptest.c testsuite.c pluginviewer.c NTMakefile
sfsasl.lo: sfsasl.c
diff --git a/plugins/gssapi.c b/plugins/gssapi.c
--- a/plugins/gssapi.c
+++ b/plugins/gssapi.c
@@ -652,11 +652,12 @@ static void gssapi_common_mech_free(void *global_context __attribute__((unused))
* flags negotiated by GSSAPI to determine If confidentiality or integrity are
* used. These flags are stored in text->qop transalated as layers by the
* caller */
-static int gssapi_spnego_ssf(context_t *text, const sasl_utils_t *utils,
+static int gssapi_spnego_ssf(context_t *text,
+ const sasl_utils_t *utils __attribute__((unused)),
sasl_security_properties_t *props,
sasl_out_params_t *oparams)
{
- OM_uint32 maj_stat = 0, min_stat = 0;
+ OM_uint32 __attribute__((unused)) maj_stat = 0, min_stat = 0;
OM_uint32 max_input;
if (text->qop & LAYER_CONFIDENTIALITY) { |
In fact, when utils/pluginviewer.c:getpath() is called, the context parameter is always set, so PLUGINDIR built in libsasl2 is always used. Likewise for sample/sample-client.c. No need for PLUGINDIR in utils/Makefile.am: --- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -89,7 +89,7 @@ libsfsasl2_la_SOURCES =
libsfsasl2_la_LIBADD = sfsasl.lo
libsfsasl2_la_LDFLAGS = -version-info 1:0:0 -export-dynamic -rpath $(libdir)
-AM_CPPFLAGS=-I$(top_srcdir)/include -I$(top_builddir)/include @SASL_DB_INC@ -DPLUGINDIR='"${plugindir}"'
+AM_CPPFLAGS=-I$(top_srcdir)/include -I$(top_builddir)/include @SASL_DB_INC@
EXTRA_DIST = saslpasswd2.8 sasldblistusers2.8 pluginviewer.8 sfsasl.h sfsasl.c smtptest.c testsuite.c pluginviewer.c NTMakefile
sfsasl.lo: sfsasl.c
diff --git a/utils/pluginviewer.c b/utils/pluginviewer.c
--- a/utils/pluginviewer.c
+++ b/utils/pluginviewer.c
@@ -193,12 +193,7 @@ getpath(void *context,
if (! path) {
return SASL_BADPARAM;
}
-
- if (searchpath) {
- *path = searchpath;
- } else {
- *path = PLUGINDIR;
- }
+ *path = searchpath;
return SASL_OK;
}
diff --git a/sample/sample-client.c b/sample/sample-client.c
--- a/sample/sample-client.c
+++ b/sample/sample-client.c
@@ -197,11 +197,7 @@ getpath(void *context,
if (! path)
return SASL_BADPARAM;
- if (searchpath) {
- *path = searchpath;
- } else {
- *path = PLUGINDIR;
- }
+ *path = searchpath;
return SASL_OK;
}
|
@dilyanpalauzov the patches look ok to me but I think we need a DCO from you. |
Best to open this as a PR w/ the commit sign off to meet the DCO requirements. |
Closes cyrusimap#339 Most of the changes mentioned there were already committed in cyrusimap#528 This commit just removes some unused references to PLUGINDIR. Signed-off-by: Howard Chu <hyc@symas.com>
The only relevant parts remaining were all deletions so I guess there's nothing creative to deal with. |
From: Dilyan Palauzov
Bugzilla-Id: 3401
Version: 2.1.x
Owner: Ken Murchison
The text was updated successfully, but these errors were encountered: