Bug 981033

Summary: Local user's krb5cc deleted by pam_winbind
Product: [Fedora] Fedora Reporter: David Woodhouse <dwmw2>
Component: sambaAssignee: Andreas Schneider <asn>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: abokovoy, asn, dwmw2, gdeschner, jlayton, sbose, ssorce, stijn
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-12 12:37:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Woodhouse 2013-07-03 20:10:04 UTC
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 20:11:27 UTC
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 09:46:12 UTC
I will look into it. Thanks for the bug report!

Comment 3 David Woodhouse 2013-07-11 10:50:52 UTC
Koji scratch build with the above patch (to prevent my users from lynching me when winbind keeps stealing their TGTs) at
http://koji.fedoraproject.org/koji/taskinfo?taskID=5593624

Comment 4 Andreas Schneider 2013-07-11 11:44:42 UTC
Yes, the patch looks fine. I will propose it upstream. Thanks!

Comment 5 Andreas Schneider 2013-07-11 11:46:56 UTC
How do you reproduce it?

Comment 6 David Woodhouse 2013-07-11 20:03:41 UTC
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 21:01:22 UTC
That reproducer was mentioned in the uptream bug btw.

Comment 8 Stijn Hoop 2013-08-12 11:33:23 UTC
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 12:37:40 UTC
This has been fixed in Samba 4.0.8.