New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #40885 (closed defect: fixed)

Opened 11 months ago

Last modified 11 months ago

cyrus-sasl2 @2.1.25_4 doesn't contain LOGIN/PLAIN mechanism

Reported by: congling@… Owned by: jmpp@…
Priority: Normal Milestone:
Component: ports Version: 2.2.0
Keywords: Cc: landonf@…, JustinVallon@…, lwarxx@…, perry@…, post@…, carter.tjoseph@…, tjcarter@…, raimue@…
Port: cyrus-sasl2

Description (last modified by ryandesign@…) (diff)

Compile and run the following code after install cyrus-sasl2, it would show just "EXTERNAL". But when using cyrus-sasl 2.1.26 source from ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-2.1.26.tar.gz, it would return the following mechanism. This issue will let the svn client unable to connect to the server with LOGIN/PLAIN authentication mechanism

mech:EXTERNAL
mech:APOP
mech:DHX
mech:WEBDAV-DIGEST
mech:ANONYMOUS
mech:CRAM-MD5
mech:DIGEST-MD5
mech:GSSAPI
mech:LOGIN
mech:NTLM
mech:OTP
mech:PLAIN
mech:PPS
mech:MS-CHAPv2
mech:SMB-NT
mech:SMB-NTLMv2

source code:

#include <stdio.h>
#include <sasl/sasl.h>

int main(){
        const char* np;
	const char** p;
	int result;
	
	result=sasl_client_init(NULL);
            
       /* check to see if that worked */
        if (result!=SASL_OK) {
		printf("failed to init\n");
		return 1;
	}
	else
		printf("success to init\n");
	p = sasl_global_listmech();
        for (np= *p; np != NULL; np=*(++p)) {
            printf("mech:%s\n",np);
        }

	return 0;
}

Attachments

Portfile (4.4 KB) - added by carter.tjoseph@… 11 months ago.
Someone suggested attaching the updated Portfile on irc
ltconfig_rpath_fallback.diff (921 bytes) - added by carter.tjoseph@… 11 months ago.
Fix 2.1.26's libtool to fallback to $rpath if $LD_RUN_PATH is unset

Change History

comment:1 Changed 11 months ago by ryandesign@…

  • Description modified (diff)
  • Cc landonf@… added
  • Keywords sasl svn removed
  • Milestone MacPorts 2.2.1 deleted
  • Owner changed from macports-tickets@… to jmpp@…
  • Port set to cyrus-sasl2

comment:2 Changed 11 months ago by lwarxx@…

Same here (can be related to OS X Mavericks):

$ /opt/local/sbin/saslauthd -v
saslauthd 2.1.25
authentication mechanisms: getpwent kerberos5 pam rimap

comment:3 Changed 11 months ago by carter.tjoseph@…

I just edited the Portfile to change version to 2.1.26, revision to 0, nuked all of the patch files (all of which show as previously applied), and updated the rmd160/sha256 checksums. Then I upgraded. SASL now works. :) Tested with mutt-devel and svn.

Changed 11 months ago by carter.tjoseph@…

Someone suggested attaching the updated Portfile on irc

comment:4 Changed 11 months ago by carter.tjoseph@…

It's apparently not as simple as a new Portfile. This break's cyrus-sasl2's binaries because upstream uses a version of libtool 1.3.5. *sobs*

I've gone through and quickly updated libtool in the port the quick and dirty way, but … it's quick and it's dirty. Basically I started with a distclean'd tree and ran glibtool --copy and did everything it told me I ought to do: AC_CONFIG_MACRO_DIR([config]) in configure.in, ACLOCAL_AMFLAGS = -I config in Makefile.am, abd adding several files to aclocal.m4. Didn't see something resembling autogen.sh/bootstrap.sh so I had to do that by hand. I did not generate one patch per file as is the custom because it'd be absolutely nuts to do it.

This "fixes" cyrus-sasl2 as far as port is concerned, but recreates the original bug this ticket is trying to address.

Changed 11 months ago by carter.tjoseph@…

Fix 2.1.26's libtool to fallback to $rpath if $LD_RUN_PATH is unset

comment:5 Changed 11 months ago by carter.tjoseph@…

BOOM! A one line patch fixes the 2.1.26 build. I'm not 100% sure this is the most "correct" solution, but it is the most correct solution given the upstream choice to use LD_RUN_PATH as if it contains a single directory. Mutt still works, and so now do the included utilities such as pluginviewer.

comment:6 follow-up: ↓ 16 Changed 11 months ago by JustinVallon@…

[Started looking at this last night, and just finished digging into the cause. It appears there might be a proposed patch, but I'll comment anyway]

Previously, there were /opt/local/lib/sasl2/lib*.la files generated by GNU libtool. However, those files no longer exist (any of them). I have not looked into why.

The plugin mechanism searches the plugin directory for *.la and *.plugin (strcmps around lib/dlopen.c:_sasl_load_plugins:509), but finds neither. With the *.la files, it scans them for /dlname='(.*)'/ to determine the name of the shared library. In my build, LA_SUFFIX=".la" and SO_SUFFIX=".plugin" (lib/dlopen.c).

I copied libplain.la and libsasldb.la from backup, and PLAIN/sasldb started working again.

comment:7 Changed 11 months ago by JustinVallon@…

  • Cc JustinVallon@… added

Cc Me!

comment:8 Changed 11 months ago by lwarxx@…

  • Cc lwarxx@… added

Cc Me!

comment:9 Changed 11 months ago by perry@…

  • Cc perry@… added

Cc Me!

comment:10 Changed 11 months ago by perry@…

Variations on this are breaking libetpan's SASL support (which comes from cyrus-sasl2) and things that depend on it in turn like claws-mail. Any thoughts on a final fix?

comment:11 Changed 11 months ago by post@…

  • deleted, sorry, im new :-) -
Last edited 11 months ago by post@… (previous) (diff)

comment:12 Changed 11 months ago by post@…

  • Cc post@… added

Cc Me!

comment:13 Changed 11 months ago by carter.tjoseph@…

  • Cc carter.tjoseph@… added

Cc Me!

comment:14 Changed 11 months ago by tjcarter@…

  • Cc tjcarter@… added

Cc Me!

comment:15 Changed 11 months ago by raimue@…

  • Cc raimue@… added

Cc Me!

comment:16 in reply to: ↑ 6 Changed 11 months ago by raimue@…

Replying to JustinVallon@…:

Previously, there were /opt/local/lib/sasl2/lib*.la files generated by GNU libtool. However, those files no longer exist (any of them). I have not looked into why.

MacPorts >= 2.2.0 removes/modifies glibtool's .la files to prevent overlinking, see #38010 for the discussion and details.

comment:17 follow-up: ↓ 18 Changed 11 months ago by perry@…

Raimue: so what is the correct solution here? Is there a way to override the removal of the .la files during install?

comment:18 in reply to: ↑ 17 Changed 11 months ago by raimue@…

Yes, that can be changed using

destroot.delete_la_files no

in the Portfile.

I am not sure whether this would be a real solution. It is solved in different ways in other distributions. For example, Debian patches cyrus-sasl2 to load plugins directly by the *.so name instead of looking for the *.la files.

comment:19 Changed 11 months ago by perry@…

Just adding that to the portfile doesn't seem to change the output of /opt/local/sbin/saslauthd -v to indicate (for example) cram-md5....

comment:20 Changed 11 months ago by post@…

Thanks raimue, it solves my problem. Now subversion works again.

comment:21 Changed 11 months ago by raimue@…

  • Status changed from new to closed
  • Resolution set to fixed

Updated to cyrus-sasl2 to 2.1.26 in r112740. The test code given in the original report returns multiple mechanisms for me, marking as fixed.

comment:22 Changed 11 months ago by jmr@…

Are you sure it was OK to remove patch-utils_Makefile.in.diff? That change has not been applied in the new version.

comment:23 Changed 11 months ago by raimue@…

You are right, I restored it in r112766.

comment:24 Changed 11 months ago by JustinVallon@…

In 2.1.26_4, shared libs in /opt/local/lib/sasl2 are now named lib*.plugin, and the dlopen code finds and opens them. The PLAIN and SASLDB plugins are working for me (without needing the lib*.la files).

In follow up to response #2: "saslauthd -v" output is unchanged, but I don't know either way what the correct output should be.

Note: See TracTickets for help on using tickets.