Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the XML-Stream CPAN distribution.

Report information
The Basics
Id: 24817
Status: resolved
Priority: 0/
Queue: XML-Stream

People
Owner: dapatrick [...] cpan.org
Requestors: Marcin.Kasperski [...] mekk.waw.pl
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.22
Fixed in:
  • 1.23
  • 1.23_01



Subject: Error (invalid client_new params) during SASL authentication
I got the following backtrace while trying to connect Log::Dispatch::Jabber to jabber.eu (which uses SASL authentication). The following line can be found in Stream.pm $self->{SIDS}->{$sid}->{sasl}->{client} = $sasl->client_new(); while it seems client_new expects at least two parameters (service and host). Usage: Authen::SASL::Cyrus::client_new(pkg, parent, service, host, iplocalport = NULL, ipremoteport = NULL) at /usr/share/perl5/Authen/SASL.pm line 74. at /usr/share/perl5/Authen/SASL.pm line 73 Authen::SASL::client_new('Authen::SASL=HASH(0x8e52d68)') called at /usr/share/perl5/XML/Stream.pm line 2123 XML::Stream::SASLClient('XML::Stream=HASH(0x8206e3c)', 1386672598, 'Mekk', 'thoeghei') called at /usr/local/share/perl/5.8.8/Net/XMPP/Protocol.pm line 1921 Net::XMPP::Protocol::AuthSASL('Net::Jabber::Client=HASH(0x8206968)') called at /usr/local/share/perl/5.8.8/Net/XMPP/Protocol.pm line 1770 Net::XMPP::Protocol::AuthSend('Net::Jabber::Client=HASH(0x8206968)') called at /usr/local/share/perl/5.8.8/Log/Dispatch/Jabber.pm line 281 Log::Dispatch::Jabber::_send('Log::Dispatch::Jabber=HASH(0x8206938)') called at /usr/local/share/perl/5.8.8/Log/Dispatch/Jabber.pm line 250 Log::Dispatch::Jabber::log_message('Log::Dispatch::Jabber=HASH(0x8206938)', 'level', 'alert', 'name', 'jabberlog', 'message', 'This is alert message\x{a}') called at /usr/share/perl5/Log/Dispatch/Output.pm line 41 (... the rest not important here ...) Versions: perl - 5.8.8 (debian) Authen::SASL - 2.10 (newest on CPAN at the moment) XML::Stream - 1.22 (as above) OS - Debian testing
This patch to XML::Stream will fix the SASL authentication Since the maintainer has gone MIA for 3+ years, I'll probably be hijacking this module shortly to fix the bug.
This patch to XML::Stream will fix the SASL authentication Since the maintainer has gone MIA for 3+ years, I'll probably be hijacking this module shortly to fix the bug.
--- Stream.pm 2004-08-25 09:23:32.000000000 -0500 +++ Stream.pm.new 2009-12-17 18:08:08.000000000 -0600 @@ -1160,7 +1160,7 @@ $self->{SOCKETS}->{*STDIN} = $sid; } - delete($self->{SIDS}->{$currsid}); +# delete($self->{SIDS}->{$currsid}); if (exists($self->GetRoot($sid)->{version}) && ($self->GetRoot($sid)->{version} ne "")) @@ -2120,7 +2120,7 @@ } ); - $self->{SIDS}->{$sid}->{sasl}->{client} = $sasl->client_new(); + $self->{SIDS}->{$sid}->{sasl}->{client} = $sasl->client_new('xmpp', $self->{SIDS}->{$sid}->{hostname}); $self->{SIDS}->{$sid}->{sasl}->{username} = $username; $self->{SIDS}->{$sid}->{sasl}->{password} = $password; $self->{SIDS}->{$sid}->{sasl}->{authed} = 0;
I'm the new maintainer of XML::Stream. New releases of XML::Stream, Net::Jabber, and Net::XMPP. Will be released before the end of the month if you can hold out for that. Thanks for the patch.
From: toddr [...] null.net
Thanks, Actually as I've thought more about this, I think actually Net::XMPP needs to be passing in 'xmpp', rather than it being hard coded in XML::Stream. So both modules would probably need a mod. Where are you maintaining the source? I've updated a bunch of the code already by forking gitpan on github: http://github.com/toddr/XML-Stream
Todd,

I've also forked from gitpan: http://github.com/dap/XML-Stream.

I think you're right about passing the service name from Net::XMPP to XML::Stream for the client_new() invocation, since XML::Stream is meant to be generically useful for XML stream-based protocols.

I'll fix that up Todd and thanks for your work on this.  I'll likely pull from your git repo and move forward from there.

Darian
On Wed Dec 30 10:00:36 2009, DAPATRICK wrote:
Show quoted text
> I think you're right about passing the service name from Net::XMPP to
> XML::Stream for the client_new() invocation, since XML::Stream is
> meant to be
> generically useful for XML stream-based protocols.

Actually, I changed my mind.  I think it's fine to have "xmpp" hard-coded the way that you have it.  Net::XMPP and XML::Stream are only fake separate right now.  XML::Stream already contains XMPP-specific code and SASL authen wasn't a part of the Jabber (ie., pre-XMPP) protocol if I recall correctly.
Todd,

I've integreated your patch with some minor changes.  Please test it out.  I've pushed to my repo on github.  I'll leave this ticket open for comments for one week from today.

Thanks,

Darian