Bug 510036 - offlineimap 6.1.0 can't login via Kerberos anymore
offlineimap 6.1.0 can't login via Kerberos anymore
Product: Fedora
Classification: Fedora
Component: offlineimap (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Christoph Höger
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-07-07 10:20 EDT by Michal Schmidt
Modified: 2010-06-28 09:30 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-06-28 09:30:35 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
offlineimap log from 6.0.3 (working) (7.24 KB, text/plain)
2009-07-07 10:20 EDT, Michal Schmidt
no flags Details
offlineimap log from 6.1.0 (broken) (99.88 KB, text/plain)
2009-07-07 10:21 EDT, Michal Schmidt
no flags Details
new imaplib2 from upstream (69.72 KB, text/x-python)
2009-07-10 04:53 EDT, Christoph Höger
no flags Details

  None (edit)
Description Michal Schmidt 2009-07-07 10:20:41 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):

How reproducible:

Steps to Reproduce:
1. kinit
2. offlineimap
Actual results:
offlineimap prompts me to "Enter password:".

Expected results:
offlineimap should be able to login using my Kerberos ticket.

Additional info:
See the attached logs from 6.0.3 and 6.1.0 made using offlineimap -d imap -l /tmp/log.txt.
Comment 1 Michal Schmidt 2009-07-07 10:21:24 EDT
Created attachment 350805 [details]
offlineimap log from 6.1.0 (broken)
Comment 2 Christoph Höger 2009-07-07 14:27:00 EDT
Hi Michal,

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.


Comment 3 Michal Schmidt 2009-07-08 20:18:51 EDT
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
--- a/offlineimap/imaplib2.py
+++ b/offlineimap/imaplib2.py
@@ -142,6 +142,7 @@ class Request(object):
     def get_response(self, exc_fmt=None):
         self.callback = None
+        self.ready.clear()
         if self.aborted is not None:
             typ, val = self.aborted
Comment 4 Christoph Höger 2009-07-09 05:04:25 EDT
That looks correct. Did that fix your bug?
Comment 5 Michal Schmidt 2009-07-09 06:29:02 EDT
Yes, I'm using offlineimap 6.1.0 + this single line patch and it's working fine for me with Kerberos now.
Comment 6 Christoph Höger 2009-07-10 04:53:14 EDT
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.
Comment 7 Michal Schmidt 2009-07-10 08:01:11 EDT
Yes, this new version of imaplib2 fixes the bug.
Comment 8 Fedora Update System 2009-07-17 10:13:40 EDT
offlineimap-6.1.2-1.fc11 has been submitted as an update for Fedora 11.
Comment 9 Fedora Update System 2009-07-22 17:48:05 EDT
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
Comment 10 Bug Zapper 2010-04-27 11:31:50 EDT
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: 
Comment 11 Bug Zapper 2010-06-28 09:30:35 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.