Skip to content

Commit

Permalink
Allow Line Feed & Carriage Return as safe chars
Browse files Browse the repository at this point in the history
  • Loading branch information
alimirjamali committed Aug 31, 2024
1 parent 2a9664f commit 50ccbfc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions qubesusbproxy/core3ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 50ccbfc

Please sign in to comment.