Bug 823541

Summary: Test case failure: USB client filter - Block device from cmd: filter doesn't pass any device, not just filtered one
Product: Red Hat Enterprise Linux 6 Reporter: David Jaša <djasa>
Component: spice-gtkAssignee: Christophe Fergeau <cfergeau>
Status: CLOSED NOTABUG QA Contact: Desktop QE <desktop-qa-list>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.3CC: acathrow, cfergeau, dblechte, dyasny, hdegoede, marcandre.lureau, syeghiay
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-30 12:58:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Jaša 2012-05-21 13:41:18 UTC
Filed from caserun (INSERT URL HERE)

when I specify "8,-1,-1,-1,0" filter string, it is expected that mass storage devices are not shared automagically, but anything other is. This does not work from command line and all device are blocked from autosharing.

The bug doesn't occur for controller-driven client (launched via XPI test page).

Version-Release number of selected component (if applicable):
RHEL6.3-20120518.n.0
spice-gtk-0.11-9.el6.i686
virt-viewer-0.5.2-8.el6.i686

Steps to Reproduce: 
Connect SPICE client to SPICE guest with USB Share enabled in console:

remote-viewer spice://$HOST?port=$PORT --spice-usbredir-filter="8,-1,-1,-1,0" --spice-debug

Actual results: 
No device is shared (tested with smartcard reader & multifunction printer).

Expected results:
USB Mass storage device should be filtered out and that's why not plugged into
SPICE guest

Comment 1 David Jaša 2012-05-21 13:59:16 UTC
the --debug --spice-debug output isn't much informative. When the device is plugged & subsequently filtered, the output says:

($0:$PID): GSpice-DEBUG: usb-device-manager.c595:device added $ID

where IDs are:
0x84c7b90
0x8670408
0x84c7b90

one of them is smartcard reader, one is USB multifunction printer, one is mass storage. Only mas storage should be filtered.

Comment 3 Marc-Andre Lureau 2012-05-22 12:59:44 UTC
Hans, could you look at it?

Comment 4 Hans de Goede 2012-05-22 14:34:37 UTC
This is expected behavior, the default behavior for the filter is to deny redirecting anything not specificaly allowed. IOW if there are no matches in the provided filter the result is deny / 0. What you want is a filter string of: "8,-1,-1,-1,0|-1,-1,-1,-1,1"

Comment 5 David Jaša 2012-05-30 12:58:00 UTC
(In reply to comment #4)
> This is expected behavior, the default behavior for the filter is to deny
> redirecting anything not specificaly allowed. IOW if there are no matches in
> the provided filter the result is deny / 0. What you want is a filter string
> of: "8,-1,-1,-1,0|-1,-1,-1,-1,1"

Confirmed, I'll update the test cases to reflect that. Thanks for response.