diff --git a/qubesusbproxy/core3ext.py b/qubesusbproxy/core3ext.py index 799bff6..a5ab155 100644 --- a/qubesusbproxy/core3ext.py +++ b/qubesusbproxy/core3ext.py @@ -642,9 +642,10 @@ async def on_device_attach_usb(self, vm, event, device, options): else: # TODO: sanitize and include stdout sanitized_stderr = ''.join( - [chr(c) for c in e.stderr if 0x20 <= c < 0x80]) + [chr(c) for c in e.stderr if 0x20 <= c < 0x80 + or c in [0x0A, 0x0D]]) raise QubesUSBException( - 'Device attach failed: {}'.format(sanitized_stderr)) + 'Device attach failed:\n{}'.format(sanitized_stderr)) finally: modify_qrexec_policy('qubes.USB+{}'.format(device.ident), policy_line, False)