Bug 1032154 - gdm calls pam_setcred with PAM_ESTABLISH_CRED instead of PAM_REINITIALIZE_CRED during screen unlock
gdm calls pam_setcred with PAM_ESTABLISH_CRED instead of PAM_REINITIALIZE_CRE...
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: gdm (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Ray Strode [halfline]
Desktop QE
: OtherQA
Depends On:
Blocks: 1029374
  Show dependency treegraph
Reported: 2013-11-19 10:56 EST by Nalin Dahyabhai
Modified: 2014-06-18 03:31 EDT (History)
3 users (show)

See Also:
Fixed In Version: gdm-3.8.4-8.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-06-13 05:57:29 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
GNOME Desktop 691269 None None None Never

  None (edit)
Description Nalin Dahyabhai 2013-11-19 10:56:49 EST
Description of problem:
When I log in using gdm and gnome-shell and then lock the screen, on unlock gdm is calling pam_setcred with the wrong flag (it uses PAM_ESTABLISH_CRED instead of PAM_REINITIALIZE_CRED).  If a module in the PAM configuration is going to do different things based on that flag, the wrong thing can happen.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Use authconfig to enable NIS and Kerberos, which should force the system to use pam_krb5.
2. Add this to your /etc/krb5.conf's [appdefaults] section:
  pam = {
    debug = true
3. Log in, lock the screen, and unlock it.

Actual results:
/var/log/secure will note something like: 
Nov 19 10:38:56 blah gdm-password]: pam_krb5[2258]: pam_setcred(PAM_ESTABLISH_CRED) returning 0 (Success)

Expected results:
/var/log/secure will note something like: 
Nov 19 10:38:56 blah gdm-password]: pam_krb5[2258]: pam_setcred(PAM_REINITIALIZE_CRED) returning 0 (Success)

Additional info:
While this appears to work when the default ccache is configured to a location that doesn't change (so that when the module attempts to create a new ccache, it happens to use the same location that was also used when the user logged in), if you configure it to use a per-session location (say, FILE:/tmp/krb5cc_%{uid}_XXXXXX), it'll create a new ccache every time the user unlocks their screen, and the ccache that the user is actually using won't be updated.
Comment 2 Ray Strode [halfline] 2013-11-20 14:34:10 EST
i've pushed a fix for this upstream. devack+
Comment 4 Nalin Dahyabhai 2013-11-22 16:09:42 EST
3.8.4-8.el7 fixes it for me, too.
Comment 5 Stephan Wiesand 2014-01-03 12:21:02 EST
Any chance you could make the binary rpms available? I'd like to verify that this also fixes the renewal of AFS tokens when the screen is unlocked - right now, pam_krb5 does acquire a fresh token but I think it ends up in a different PAG.

I'd patch and build myself, but 7.0 beta doesn't ship many of the build requirements.

Comment 6 Ray Strode [halfline] 2014-01-06 11:31:10 EST
Stephan, thank you for doing additional testing.  You can find test builds here:

Comment 7 Stephan Wiesand 2014-01-07 05:15:00 EST
Thanks a lot. I can confirm that with these the AFS token renewal works as expected when the screen is unlocked.
Comment 8 Vadim Rutkovsky 2014-03-24 09:13:32 EDT
Setting the status to Verified per comment #4 and #7
Comment 9 Ludek Smid 2014-06-13 05:57:29 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

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