You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
python3/usb_scan: Skip empty lines in usb-policy.conf, add more comments (#6616)
Allow empty lines in usb-policy.conf (it's standard practice in similar
configuration files to allow both comments and empty lines, and it can
help readability quite a bit).
Previously, the script would fail in a rather unhelpful manner:
Traceback (most recent call last):
File "/opt/xensource/libexec/usb_scan.py", line 681, in <module>
pusbs = make_pusbs_list(devices, interfaces)
File "/opt/xensource/libexec/usb_scan.py", line 660, in make_pusbs_list
policy = Policy()
File "/opt/xensource/libexec/usb_scan.py", line 384, in __init__
self.parse_line(line)
File "/opt/xensource/libexec/usb_scan.py", line 444, in parse_line
if action.lower() == "allow":
UnboundLocalError: local variable 'action' referenced before assignment
See this forum thread for a user figuring this out on their own:
https://xcp-ng.org/forum/topic/11091/usb-passthrough-has-stopped-working-after-update-and-updating-usb-policy.conf/
Add some more comments to usb-policy.conf to help debug cases like the
above.
0 commit comments