RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1159056 - pam_pkcs11 with card_only breaks session selection
Summary: pam_pkcs11 with card_only breaks session selection
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: gdm
Version: 7.0
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Ray Strode [halfline]
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On: 1163474
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-30 19:12 UTC by adam winberg
Modified: 2018-07-19 19:24 UTC (History)
4 users (show)

Fixed In Version: gdm-3.8.4-32.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1163474 (view as bug list)
Environment:
Last Closed: 2015-03-05 13:28:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
full-journal.log (293.66 KB, text/plain)
2014-10-31 21:03 UTC, adam winberg
no flags Details
saved-user-config (197 bytes, text/plain)
2014-10-31 21:04 UTC, adam winberg
no flags Details
propagate user's session in accounts service to shell in the case we don't know the username up front (2.73 KB, patch)
2014-11-12 18:58 UTC, Ray Strode [halfline]
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0551 0 normal SHIPPED_LIVE gdm bug fix update 2015-03-05 16:45:17 UTC

Description adam winberg 2014-10-30 19:12:09 UTC
Description of problem:
When using smartcard for auth, with password and fingerprint auth disabled, and pam_pkcs11 with card_only enabled, we cant choose any session other than the default (gnome classic). The card_only parameter is supposed to get the username from the card instead of prompting for it, but this does not seem to work. Not sure if problem lies in pam_pkcs11 or gdm. If I disable 'card_only' I get a prompt for username in the gdm login and then the session selection works fine.  

Version-Release number of selected component (if applicable):
gdm-3.8.4-28.el7_0.1
pam_pkcs11-0.6.2-17

How reproducible:
Always

Steps to Reproduce:
1. Enable smartcard auth using pam_pkcs11 and parameter card_only enabled.
2. Boot to gdm login window, you should get a prompt for smartcard pin. 
3. Select 'Gnome' in session list and login.

Actual results:
You get logged in to gnome classic.

Expected results:
You get logged in to 'regular' gnome.

Additional info:

Comment 2 Ray Strode [halfline] 2014-10-31 14:09:13 UTC
First thing, do mind trying this?

1) enable card_only again
2) press ctrl-alt-f6
3) when prompted for a username just hit spacebar and then enter (so use " " as a username)
4) type your smartcard pin

Does it correctly identify the username then?

Second thing, after the misbehavior you've described in this bug report has happened, and you've applied your "no card_only" workaround to then successfully log into the desired selected session, can you then undo the workaround and from that point forward will it:

a) remember the selection from when the workaround was in place regardless of what the user picks from session menu
b) honor whatever the user picks from the sesison menu
c) revert back to gnome-classic

?

Do you know which pam_pkcs11 mapper module you're using?

Comment 3 adam winberg 2014-10-31 18:12:21 UTC
Of course!

1. Yes, my username is correctly identified if i logon a VT with " " as username with card_only enabled (neat trick btw, did not know i didnt have to put username there, although it makes sense). 

2. If I revert back to card_only I am back to the same behaviour, i get gnome classic always. In the session list 'gnome classic' is pre-selected regardless of what session I choosed before. 

We use the cn mapper in pam_pkcs11.

Comment 4 Ray Strode [halfline] 2014-10-31 20:16:49 UTC
hey thanks for the fast response, it's very helpful!

Do you mind,

1) running mkdir -p /var/log/journal
2) adding Enable=true to the [debug] section of /etc/gdm/custom.conf
3) rebooting and then reproducing
4) running journalctl -b -l > full-journal.log

and attaching full-journal.log?  That will enable debug information that should give us a clearer picture of what's going on.

Also, do you mind running

tail /var/lib/AccountsService/users/* > saved-user-config.txt

and attaching saved-user-config.txt?  That will show what sessions were saved in the accountsservice for each user.

Comment 5 adam winberg 2014-10-31 21:03:41 UTC
Created attachment 952614 [details]
full-journal.log

journal output from boot with gdm debug enabled

Comment 6 adam winberg 2014-10-31 21:04:36 UTC
Created attachment 952615 [details]
saved-user-config

AccountsService user information

Comment 7 Ray Strode [halfline] 2014-11-12 18:58:59 UTC
Created attachment 956853 [details]
propagate user's session in accounts service to shell in the case we don't know the username up front

So I debugged this a little bit a few days ago with your colleague, Patrik Martinsson.

There are two fixes needed.  One on the gdm side is a change to handle when is to make sure we report the users session as soon as we find it in the case we don't know the username up front (such as is the case with smartcards)

Comment 8 Ray Strode [halfline] 2014-11-12 18:59:26 UTC
The second fix is a change to gnome-shell to make sure we don't inform GDM about session-changes in the gear menu that were made at the request of GDM (which is creating an oscillation between the two processes after the above patch is applied)

I'll clone this bug against gnome-shell.

Comment 13 errata-xmlrpc 2015-03-05 13:28:35 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0551.html

Comment 14 kbell 2018-07-19 19:24:10 UTC
I encountered this behavior using a current CentOS 7 workstation:

cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)

# uname -r
3.10.0-862.9.1.el7.x86_64

# rpm -q gdm
gdm-3.26.2.1-5.el7.x86_64


Has the fix described in this bug report been reverted perhaps?


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