Bug 981033 - Local user's krb5cc deleted by pam_winbind
Local user's krb5cc deleted by pam_winbind
Product: Fedora
Classification: Fedora
Component: samba (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Andreas Schneider
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-07-03 16:10 EDT by David Woodhouse
Modified: 2013-08-12 08:37 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-08-12 08:37:40 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Samba Project 9994 None None None Never

  None (edit)
Description David Woodhouse 2013-07-03 16:10:04 EDT
When I get my password wrong, winbindd *deletes* my existing, valid, credentials cache.

This is particularly horrid of it when I'm running as a user who doesn't exist in the domain, so even when I subsequently get my password *right*, it's matched by pam_unix not pam_winbind, and I don't even get my TGT recreated.
Comment 1 David Woodhouse 2013-07-03 16:11:27 EDT
Trying this patch now, which will probably make me happy but I'm not fully aware of the other implications of it:

--- a/source3/winbindd/winbindd_pam.c
+++ b/source3/winbindd/winbindd_pam.c
@@ -691,6 +691,8 @@ failed:
 	 * local host and therefor didn't get the PAC, we need to remove that
 	 * cache entirely now */
+	if (user_ccache_file)
+		return result;
 	krb5_ret = ads_kdestroy(cc);
 	if (krb5_ret) {
 		DEBUG(3,("winbindd_raw_kerberos_login: "
Comment 2 Andreas Schneider 2013-07-05 05:46:12 EDT
I will look into it. Thanks for the bug report!
Comment 3 David Woodhouse 2013-07-11 06:50:52 EDT
Koji scratch build with the above patch (to prevent my users from lynching me when winbind keeps stealing their TGTs) at
Comment 4 Andreas Schneider 2013-07-11 07:44:42 EDT
Yes, the patch looks fine. I will propose it upstream. Thanks!
Comment 5 Andreas Schneider 2013-07-11 07:46:56 EDT
How do you reproduce it?
Comment 6 David Woodhouse 2013-07-11 16:03:41 EDT
sudo whoami
 <get password wrong>

Do not subsequently get your password *right*, if you are actually authenticated by pam_winbind. That'll give you a new TGT and mask the problem.

If, like me, your local username doesn't match your Windows username and you actually "log in" to winbind with 'wbinfo -K $WINUSER', the problem is much easier to notice.
Comment 7 David Woodhouse 2013-07-11 17:01:22 EDT
That reproducer was mentioned in the uptream bug btw.
Comment 8 Stijn Hoop 2013-08-12 07:33:23 EDT
Most probably related to https://bugzilla.samba.org/show_bug.cgi?id=9108
(we were seeing the same thing and searched in samba BZ first)
Comment 9 Andreas Schneider 2013-08-12 08:37:40 EDT
This has been fixed in Samba 4.0.8.

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