Skip Menu |

This queue is for tickets about the Mail-IMAPClient CPAN distribution.

Report information
The Basics
Id: 43277
Status: resolved
Priority: 0/
Queue: Mail-IMAPClient

People
Owner: Nobody in particular
Requestors: phil [...] perkpartners.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: login() should not try authenticate() if auth is empty or undef
Date: Fri, 13 Feb 2009 21:13:00 -0500
To: bug-Mail-IMAPClient [...] rt.cpan.org
From: Phil Lobbes <phil [...] perkpartners.com>
Here's a minor bug against 3.13... The 2.2.9 version of login() would not call authenticate() unless $self->Authmechanism was set to something that would evaluate to true. Old 2.x code login: return $self->authenticate($self->Authmechanism,$self->Authcallback) if $self->{Authmechanism}; However, the 3.x login() will try call authenticate() even if the Authmechanism is set to "". For backwards compatibility, we probably shouldn't do that. Code in 3.x login: return $self->authenticate($auth, $self->Authcallback) if $auth ne 'LOGIN'; If the Authmechanism is set to "" we send an invalid authenticate request. Granted, undef would be a better value than "" if you didn't want the mechanism set to anything, but there is no practical use for trying to call authenticate() if the Authmechanism value doesn't evaluate to true (I doubt there will be a valid mechanism named "0" any time soon). Thanks! Phil Here's the simple patch: [plobbes@ps01 tmp]$ diff -u IMAPClient.pm.ORIG IMAPClient.pm --- IMAPClient.pm.ORIG 2009-02-13 21:00:02.000000000 -0500 +++ IMAPClient.pm 2009-02-13 21:00:34.000000000 -0500 @@ -331,7 +331,7 @@ { my $self = shift; my $auth = $self->Authmechanism; return $self->authenticate($auth, $self->Authcallback) - if $auth ne 'LOGIN'; + if $auth and $auth ne 'LOGIN'; my $passwd = $self->Password; if($passwd =~ m/\W/) # need to quote
Subject: Re: [rt.cpan.org #43277] login() should not try authenticate() if auth is empty or undef
Date: Mon, 16 Feb 2009 14:15:33 +0100
To: "phil [...] perkpartners.com via RT" <bug-Mail-IMAPClient [...] rt.cpan.org>
From: NLnet webmaster <webmaster [...] nlnet.nl>
* phil@perkpartners.com via RT (bug-Mail-IMAPClient@rt.cpan.org) [090214 02:14]: Show quoted text
> Fri Feb 13 21:14:07 2009: Request 43277 was acted upon. > Queue: Mail-IMAPClient > Subject: login() should not try authenticate() if auth is empty or undef > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=43277 > > > Here's a minor bug against 3.13...
... Show quoted text
> Granted, undef would be a better value than "" if you didn't > want the mechanism set to anything, but there is no practical use for
So, the actual request is to be bug-compatible with 2.* Well, there are so many other places where this is already in place, so I agree. -- Thanks for the fix, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
just release it in 3.14