Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • S spice-gtk
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 62
    • Issues 62
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • spice
  • spice-gtk
  • Issues
  • #16

Closed
Open
Created Jun 03, 2018 by Christophe Fergeau@teufOwner

smartcard passthrough can't handle multiple sessions in the same process

Submitted by Christophe Fergau Fergau @teuf

Assigned to Spice Bug List

Link to original bug (#41536)

Description

11:55 `< hansg>` teuf, I'm currently re-doing some of the usb-device-manager 
               stuff. One of the things I got wrong is that I didn't keep in 
               mind that one process can have multiple sessions open (think 
               vinagre with 2 spice tabs) 
11:57 `< hansg>` teuf, it seems you've made the same mistake with the 
               smartcard stuff. 
11:58 `< hansg>` Hmm, never mind, it seems all transfer to / from the reader 
               happen by: vreader_xfr_bytes, so as long as the 2 sessions 
               are handled by the same thread, all should be will I think
12:00 `< hansg>` One problem could be the use of vreader_set_id, actually 
               looking at the code, this will trigger for a second session: 
               g_return_if_fail(vreader_get_id(reader) == -1);
12:01 `< hansg>` I guess the mapping of ids -> readers should be moved to 
               channel-smartcard.c instead of relying on the mapping inside 
               libcacard (assuming that the id is only used for mapping and 
               not for other uses inside libcacard)
12:03 -!- yonit [~yhalperi@nat-pool-tlv-t1.redhat.com] has quit [Leaving]
12:04 `< teuf>` hansg: I definitely haven't thought at all about multiple 
              widget instances in the same process while doing the smartcard 
              stuff
12:05 `< hansg>` teuf, yeah I know that feeling :)
12:05 `< teuf>` :)
12:05 `< hansg>` Note multiple widgets (aka SpiceDisplay) != multiple sessions
12:05 `< hansg>` One session can have multiple widgets (think multi monitor)
12:05 `< teuf>` ah yup
12:06 -!- yonit [~yhalperi@nat-pool-tlv-t1.redhat.com] has joined #spice
12:07 `< hansg>` Luckily for the smartcard stuff the widget does not seem to 
               do to much, actually the only thing it does is do a 
               spice_channel_connect() on the smartcard channel. So with a 
               multi mon setup this will happen multiple times, but 
               spice-channel.c protects against this
12:12 -!- alon [~alon@85.64.131.212.dynamic.barak-online.net] has quit [Read 
          error: 145 (Connection timed out)]
12:13 `< hansg>` Hmm, channel-smartcard.c will try to send messages on 
               smartcard reader detection even if the channel is not 
               connected (think an app using spice-client-glib but not 
               spice-client-gtk)
Edited Jun 05, 2018 by Marc-André Lureau
Assignee
Assign to
Time tracking