Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs in the icon-receiver #153

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Fix bugs in the icon-receiver #153

wants to merge 3 commits into from

Conversation

qubest
Copy link

@qubest qubest commented Oct 17, 2024

  • Update guivm-gui-agent to guivm
  • When the icon-reciever running on guivm other than dom0 the header received is as follow:
    Request coming from appvm to dom0
    service vm-name keyword adminvm\x00
    
    Request coming from appvm to guivm
    service vm-name\x00
    
    The trailing \x00 cause a bug when trying to get the color of the vm using qubesadminapi.

The trailing \x00 in the request header make the domain name as follow (domain\x00).
Which cause a bug when listing domains using qubesadminapi.
This bug occured when the icon-receiver is running on guivm other than dom0.
@@ -342,7 +342,7 @@ class IconReceiver(object):
try:
# Parse header from qrexec
header = await reader.readuntil(b'\0')
header_parts = header.decode('ascii').split(' ')
header_parts = header.decode('ascii').split(' ').restrip('\x00')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

List doesn't have restrip() method. Did you mean .rstrip() just before .split() ?

Copy link
Author

@qubest qubest Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a mistake.

Yep, the rstrip should be added before split.
Or at header_parts[1].rstrip('\x00')

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better before split, as this is terminator of this whole header, not a specific part

@qubest qubest requested a review from marmarek October 22, 2024 10:43
@@ -342,7 +342,7 @@ class IconReceiver(object):
try:
# Parse header from qrexec
header = await reader.readuntil(b'\0')
header_parts = header.decode('ascii').split(' ')
header_parts = header.decode('ascii').restrip('\x00').split(' ')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
header_parts = header.decode('ascii').restrip('\x00').split(' ')
header_parts = header.decode('ascii').rstrip('\x00').split(' ')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants