Red Hat Bugzilla – Bug 510036
offlineimap 6.1.0 can't login via Kerberos anymore
Last modified: 2010-06-28 09:30:35 EDT
Created attachment 350804 [details]
offlineimap log from 6.0.3 (working)
Description of problem:
I've been using offlineimap-6.0.3-3.fc11 against a kerberized IMAP server with no problems. After upgrading to offlineimap-6.1.0-2.fc11, offlineimap is unable to login to the remote IMAP server via Kerberos and falls back to asking for a password (which works). Downgrading to 6.0.3 makes it work again.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
offlineimap prompts me to "Enter password:".
offlineimap should be able to login using my Kerberos ticket.
See the attached logs from 6.0.3 and 6.1.0 made using offlineimap -d imap -l /tmp/log.txt.
Created attachment 350805 [details]
offlineimap log from 6.1.0 (broken)
honestly, I am not quite sure, what happens with your token. The bug is probably somewhere inside imaplib2.py which is new in that release. If you could have a talk with the server admin or add some debugging code to imaplib2.py (inside offlineimaps site-package dir) that may help.
The problem: That lib does not have a real upstream. Only one developer and no collaboration tools at all.
I'll see what upstream says on that. Thanks for testing that before the push - I am going to delay the update while this bug hangs around since I guess kerberos is pretty important.
OK, here's what I found so far:
In imaplib2.py the function _command creates a Request object 'crqb' to expect an IMAP continuation, then waits for it. The Request object has a threading.Event object which gets signalled by the reader thread when the continuation arrives. The problems is _command then goes through its 'While True:' loop again and reuses the same 'crqb' object. This object has the Event already set even if no other response arrived from the server yet. So _command does not wait as it should and calls 'literator' too soon, without having meaningful data for it. The 'literator' (which is really the gssapi state machine) gets confused and aborts the authentication process.
Not sure what the proper fix is, but a slightly racy workaround could be:
diff --git a/offlineimap/imaplib2.py b/offlineimap/imaplib2.py
index 2426754..c17f3c3 100644
@@ -142,6 +142,7 @@ class Request(object):
def get_response(self, exc_fmt=None):
self.callback = None
if self.aborted is not None:
typ, val = self.aborted
That looks correct. Did that fix your bug?
Yes, I'm using offlineimap 6.1.0 + this single line patch and it's working fine for me with Kerberos now.
Created attachment 351222 [details]
new imaplib2 from upstream
Could you please check if this version of imaplib2 also fixes that bug?
Upstream asks for it.
Yes, this new version of imaplib2 fixes the bug.
offlineimap-6.1.2-1.fc11 has been submitted as an update for Fedora 11.
offlineimap-6.1.2-1.fc11 has been pushed to the Fedora 11 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
su -c 'yum --enablerepo=updates-testing update offlineimap'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-7844
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '11'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 11's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 11 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora please change the 'version' of this
bug to the applicable version. If you are unable to change the version,
please add a comment here and someone will do it for you.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
The process we are following is described here:
Fedora 11 changed to end-of-life (EOL) status on 2010-06-25. Fedora 11 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version.
Thank you for reporting this bug and we are sorry it could not be fixed.