Skip to content

Commit

Permalink
Do not allow newlines in PCI device paths
Browse files Browse the repository at this point in the history
This was presumably unintentional.

(cherry picked from commit 43d4de4)
  • Loading branch information
DemiMarie authored and marmarek committed May 13, 2023
1 parent 9c31b8d commit 4511275
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions qubes/ext/pci.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ def _device_desc(hostdev_xml):
class PCIDevice(qubes.devices.DeviceInfo):
# pylint: disable=too-few-public-methods
regex = re.compile(
r'^(?P<bus>[0-9a-f]+)_(?P<device>[0-9a-f]+)\.(?P<function>[0-9a-f]+)$')
r'\A(?P<bus>[0-9a-f]+)_(?P<device>[0-9a-f]+)\.(?P<function>[0-9a-f]+)\Z')
_libvirt_regex = re.compile(
r'^pci_0000_(?P<bus>[0-9a-f]+)_(?P<device>[0-9a-f]+)_'
r'(?P<function>[0-9a-f]+)$')
r'\Apci_0000_(?P<bus>[0-9a-f]+)_(?P<device>[0-9a-f]+)_'
r'(?P<function>[0-9a-f]+)\Z')

def __init__(self, backend_domain, ident, libvirt_name=None):
if libvirt_name:
Expand Down

0 comments on commit 4511275

Please sign in to comment.