Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be unavailable on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 815639 - [virt-viewer]virt-viewer failed to initialize smartcard when using reconnect&wait
Summary: [virt-viewer]virt-viewer failed to initialize smartcard when using reconnect&...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: spice-gtk
Version: 6.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Christophe Fergeau
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-24 06:53 UTC by zhe peng
Modified: 2013-11-21 08:24 UTC (History)
10 users (show)

Fixed In Version: spice-gtk-0.20-3.el6
Doc Type: Bug Fix
Doc Text:
Cause: spice-gtk did not handle correctly indication that software smartcard support was already initialized Consequence: software smartcard support would stop working after migration or restarting a guest Fix: don't disable software smartcard support at spice connection time if libcacard tells us software smartcard support is already initialized Result: software smartcard support should keep working across guest reboots/migrations.
Clone Of:
Environment:
Last Closed: 2013-11-21 08:24:13 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1577 0 normal SHIPPED_LIVE spice-gtk bug fix and enhancement update 2013-11-21 00:40:45 UTC

Description zhe peng 2012-04-24 06:53:04 UTC
Description of problem:
virt-viewer failed to initialize smartcard when using --reconnect & --wait.

Version-Release number of selected component (if applicable):
virt-viewer-0.5.2-6.el6.x86_64
spice-gtk-0.11-8.el6.x86_64
spice-server-0.10.1-5.el6.x86_64
spice-glib-0.11-8.el6.x86_64
pam_pkcs11-0.6.2-11.1.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. Imaging there is a running guest, and executed #yum groupinstall "smart card support".
2. run command in client:
   #virt-viewer --spice-smartcard --connect qemu:///system $guest
3. make sure the smardcard can login guest gdm,and use pklogin_finder can read the smartcard.
4. close virt-viewer,re-run virt-viewer in client:
   #virt-viewer --spice-smartcard --reconnect --wait --connect qemu:///system $guest
5. in another console,use virsh restart the guest
 #virsh destroy $guest
 #virsh start $guest
6. login guest via virt-viewer,make sure service pcscd start
7. run in guest console
   #pklogin_finder debug

Actual results:
after step 5,virt-viewer throws a warning: Failed to initialize smartcard
  smart card can't worked in guest

Expected results:
using reconnect and wait ,should keep smartcard worked when guest restart.


Additional info:
when use --spice-color-depth& --spice-disable-effects with --reconnect --wait,they all worked well.

Comment 2 Christophe Fergeau 2012-04-25 16:30:07 UTC
I can reproduce this, the steps from rhbz#815175 can be followed to create a software smartcard and test with that. I'm using pcsc_scan to check for the presence or absence of a smartcard.

Comment 3 Christophe Fergeau 2012-04-25 17:23:28 UTC
Initial investigation shows that it's the vcard_emul_init call from smartcard_manager_init which fails because libcacard is already initialized. This can be workarounded with something like this:
From 9acba6054dbc94447837e7049c8ff2f86b47b225 Mon Sep 17 00:00:00 2001
From: Christophe Fergeau <cfergeau@redhat.com>
Date: Wed, 25 Apr 2012 19:17:00 +0200
Subject: [PATCH] Don't fail when vcard_emul_init has already been called

---
 gtk/smartcard-manager.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gtk/smartcard-manager.c b/gtk/smartcard-manager.c
index 8e22e6c..f1d5836 100644
--- a/gtk/smartcard-manager.c
+++ b/gtk/smartcard-manager.c
@@ -457,7 +457,7 @@ static gboolean smartcard_manager_init(SpiceSession *session,
 
 init:
     SPICE_DEBUG("vcard_emul_init");
-    if (vcard_emul_init(options) != VCARD_EMUL_OK) {
+    if (vcard_emul_init(options) == VCARD_EMUL_FAIL) {
         *err = g_error_new(SPICE_CLIENT_ERROR,
                            SPICE_CLIENT_ERROR_FAILED,
                            "Failed to initialize smartcard");
-- 
1.7.1

but more investigation is needed because the smartcard is still not working after that.

Comment 4 Christophe Fergeau 2012-04-25 17:27:59 UTC
By the way, this can be reassigned to spice-gtk.

Comment 5 RHEL Program Management 2012-05-03 04:59:50 UTC
Since RHEL 6.3 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 7 Christophe Fergeau 2013-07-11 14:21:01 UTC
Actually, a variant of the patch from comment #3 works. Patch sent upstream: http://lists.freedesktop.org/archives/spice-devel/2013-July/013888.html

Comment 8 David Jaša 2013-07-19 16:29:40 UTC
reproduced - qa_ack+

note that the smart card support doesn't have to be configured or even installed in the guest at all, the error message appears right after second start of the guest during virt-viewer lifetime.

Comment 12 errata-xmlrpc 2013-11-21 08:24:13 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.

http://rhn.redhat.com/errata/RHBA-2013-1577.html


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