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

Move D-Bus support from bridge into usbguard-daemon. #319

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

Conversation

Allen-Webb
Copy link
Contributor

No description provided.

@Allen-Webb
Copy link
Contributor Author

I can take care of the rebase.

@Allen-Webb
Copy link
Contributor Author

I ended up having to move all the glib initialization out of the constructor into the D-Bus IPC server thread.

@Allen-Webb
Copy link
Contributor Author

The change as is doesn't currently provide a way to offer the D-Bus interface on the session bus, it is system only. I don't believe that will be a problem, but I thought I would highlight it in case you all are aware of particular reasons to also support binding to session buses.

@@ -339,6 +527,30 @@ namespace usbguard
with_interface_string.c_str());
return builder;
}

void DBusIPCServerPrivate::addAllowedUID(uid_t uid, const IPCServer::AccessControl& ac)
Copy link
Member

Choose a reason for hiding this comment

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

What is the current behavior without these functions implemented? If it is expected for them to be empty, could you add a comment to make that clear? Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a comment.

}

void IPCServer::addAllowedUID(uid_t uid, const IPCServer::AccessControl& ac)
{
d_pointer->addAllowedUID(uid, ac);
for (const auto& d_pointer : d_pointers) {
d_pointer->addAllowedUID(uid, ac);
Copy link
Member

Choose a reason for hiding this comment

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

What's the intended behavior if any of the IPC implementation fail? Should we check the return values?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There aren't return values to check. Though I did go through and convert some error log statements to exceptions, so the D-Bus IPC server better matches the behavior of the libqb IPC server code.

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

Successfully merging this pull request may close these issues.

3 participants