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 1159385 - GDM does not prompt for smartcard
Summary: GDM does not prompt for smartcard
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: gnome-shell
Version: 7.0
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Ray Strode [halfline]
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-31 18:21 UTC by adam winberg
Modified: 2015-03-05 13:22 UTC (History)
4 users (show)

Fixed In Version: gnome-shell-3.8.4-44.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1160739 (view as bug list)
Environment:
Last Closed: 2015-03-05 13:22:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
pam-files (3.85 KB, text/plain)
2014-10-31 20:54 UTC, adam winberg
no flags Details
gnome-settings-daemon --debug (66.48 KB, text/plain)
2014-11-05 13:04 UTC, adam winberg
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0535 0 normal SHIPPED_LIVE Low: GNOME Shell security, bug fix, and enhancement update 2015-03-05 16:32:34 UTC

Description adam winberg 2014-10-31 18:21:42 UTC
Description of problem:
We have smartcard authentication enabled and password/fingerprint auth disabled. We use the pam_pkcs11 module with the card_only option enabled to tell applications to get username directly from card rather than ask for it. Even so the gdm login screen does not prompt for smartcard if it is not inserted. What we get is a username prompt, and if we click 'Next' the spinner goes round and round and it just hangs, without saying anything about needing the smartcard. Inserting the smartcard makes the pin prompt appear. 

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


How reproducible:
Always

Steps to Reproduce:
1. Configure smartcard auth, disable password/fingerprint auth. Configure pam_pkcs11 with card_only option enabled.
2. Boot computer to gdm login screen without smartcard inserted
3. 

Actual results:
GDM asks for username, click next and it hangs waiting for smartcard without message.

Expected results:
GDM should not ask for username. GDM should ask the user to insert the smartcard. 

Additional info:

Comment 2 Ray Strode [halfline] 2014-10-31 20:26:20 UTC
did you set up your smartcard configuration manually or by using the authentication settings panel (authconfig-gtk)?

what's the output of

# gsettings get org.gnome.login-screen enable-smartcard-authentication
# DCONF_PROFILE=gdm gsettings get org.gnome.login-screen enable-smartcard-authentication

can you attach /etc/pam.d/smartcard-auth /etc/pam.d/password-auth and /etc/pam.d/system-auth

?

Comment 3 adam winberg 2014-10-31 20:53:28 UTC
First setup was via authconfig-gtk but its been slightly modified and is now handled via puppet. 

both gsettings commands returns 'true'.

Comment 4 adam winberg 2014-10-31 20:54:39 UTC
Created attachment 952613 [details]
pam-files

attached smartcard-auth-ac, system-auth-ac and password-auth-ac

Comment 5 Ray Strode [halfline] 2014-11-05 12:44:56 UTC
from the log on the sister bug, (bug 1159056 attachment 952614 [details]) I see this:

Oct 31 21:57:07 c20550.ad.smhi.se gnome-session[989]: (gnome-settings-daemon:1041): smartcard-plugin-WARNING **: Got potentially spurious smartcard event error: ffffe098.
Oct 31 21:57:07 c20550.ad.smhi.se gnome-session[989]: (gnome-settings-daemon:1041): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

gnome-settings-daemon is what listens for smartcard insertion events. It seems like it may have gotten into a confused state following a driver error.

Can you log in, pull out the smartcard, and then run

/usr/libexec/gnome-settings-daemon --replace --debug >& gsd.out

at terminal, insert the smartcard, and then attach gsd.out to this report?

Comment 6 adam winberg 2014-11-05 13:03:39 UTC
We lock the screen on smartcard removal, and it does not seem to be possible to run gnome-settings-daemon from console. I changed the order in your instruction a little, hope its ok:
- logged in
- started gnome-settings-daemon in debug mode
- removed smartcard
- insert smartcard. 

See attached file for details

Comment 7 adam winberg 2014-11-05 13:04:16 UTC
Created attachment 954024 [details]
gnome-settings-daemon --debug

Comment 8 Ray Strode [halfline] 2014-11-05 14:25:22 UTC
Thanks for the logs.

So the g_object_unref is actually unrelated to smartcards:

(gnome-settings-daemon:4688): color-plugin-DEBUG: failed to enumerate directory /home/a001329/.color/icc: No such file or directory

(gnome-settings-daemon:4688): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

It's a bug in the color management plugin. I'll clone that as a separate report.

The spurious events are probably harmless too, since you only get 1 or 2, and we retry 10 times.

Actually, looking in the code this looks like a logic error in /usr/share/gnome-shell/js/gdm/util.js:

    _updateDefaultService: function() {
        if (this._settings.get_boolean(PASSWORD_AUTHENTICATION_KEY))
            this._defaultService = PASSWORD_SERVICE_NAME;
        else if (this.smartcardDetected)
            this._defaultService = SMARTCARD_SERVICE_NAME;
        else if (this._haveFingerprintReader)
            this._defaultService = FINGERPRINT_SERVICE_NAME;
    },

We only use the smartcard service if a smartcard is detected, but that's not correct.  We should use the smartcard service if password-authentication is disabled.

So really instead it should be: 

    _updateDefaultService: function() {
        if (this._settings.get_boolean(PASSWORD_AUTHENTICATION_KEY))
            this._defaultService = PASSWORD_SERVICE_NAME;
        else if (this._settings.get_boolean(SMARTCARD_AUTHENTICATION_KEY))
            this._defaultService = SMARTCARD_SERVICE_NAME;
        else if (this._haveFingerprintReader)
            this._defaultService = FINGERPRINT_SERVICE_NAME;
    },

Comment 9 adam winberg 2014-11-05 15:05:01 UTC
Awesome, I changed the line in /usr/share/gnome-shell/js/gdm/util.js and it does indeed work as expected after this. I did however stumble upon another bug, but I filed this separate in #1160764

Comment 13 errata-xmlrpc 2015-03-05 13:22:09 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/RHSA-2015-0535.html


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