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

UnixFD: Handle DBus signals with Unix file descriptors #102

Merged
merged 7 commits into from
Oct 11, 2022

Conversation

poncovka
Copy link
Contributor

@poncovka poncovka commented Oct 7, 2022

GLib doesn't seem to support Unix file descriptors in signals. Swap Unix
file descriptors with indexes into a list of Unix file descriptors, but emit
just the indexes. Log a warning to inform users about the limited support.

Depends on: #101

Move all functions and classes related to the UnixFD support to dasbus.unix.
The `GLibClientUnix` class should be able to handle the result of a client
call that might contain Unix file descriptors. The `ClientObjectHandler`
class shouldn't support anything related to that.
* Remove the `variant_replace_fdlist_indices_with_handles` function.
* Remove the `variant_replace_handles_with_fdlist_indices` function.
* Use the `acquire_fds` and `restore_fds` functions instead.
Clean up unit tests for the `UnixFDSwap` class and the related code.
@poncovka poncovka added the enhancement New feature or request label Oct 7, 2022
Clean up the implementation of the existing tests and write new ones.
Set and get a property with Unix file descriptors.
GLib doesn't seem to support Unix file descriptors in signals. Swap Unix
file descriptors with indexes into a list of Unix file descriptors, but emit
just the indexes. Log a warning to inform users about the limited support.
Copy link

@M4rtinK M4rtinK left a comment

Choose a reason for hiding this comment

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

Looks good to me as far as I can tell. :)

Also noticed a probable typo. :)



def variant_replace_fdlist_indices_with_handles(v, fdlist):
"""Given a varaint and an fdlist, find any 'h' handle instances
Copy link

Choose a reason for hiding this comment

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

Looks like a typo or is some DBus type called like that ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is a typo, but the string was eventually removed in following commits.

Copy link

@VladimirSlavik VladimirSlavik left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thank you!

@poncovka poncovka merged commit 273e054 into dasbus-project:master Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

3 participants