Created attachment 68212 [details] [review] Add accessor to return the DBusGConnection that a DBusGMethodInvocation was invoked on For NetworkManager we're adding support for a private bus socket so that NM can be used in early-boot environments without a bus daemon running. That means we're setting up a DBusServer object on a private socket and making dbus-glib aware of the connections that appear on that socket. Since the authentication paths depend on which DBusGConnection the method invocation comes from, as the private socket only accepts connections from root, and since messages from the private socket don't have "sender" addresses, we need to figure out which DBusGConnection the DBusGInvocation is associated with so we can short-circuit authentication checks and always allow any connections from the private socket. Unfortunately we can't get at the DBusGConnection without doing something like: DBusGConnection *gconn = (DBusGConnection *) context; which is a complete hack. So I'd like to formalize this since it seems useful :)
Comment on attachment 68212 [details] [review] Add accessor to return the DBusGConnection that a DBusGMethodInvocation was invoked on Review of attachment 68212 [details] [review]: ----------------------------------------------------------------- Sounds fine to me, just a couple of comments about the doc-comment. ::: dbus/dbus-gobject.c @@ +3277,5 @@ > } > > +/** > + * dbus_g_method_invocation_get_g_connection: > + * @context: the method context There should be some sort of "content" in this doc-comment to placate gtk-doc. In telepathy-glib we usually do this: /** * foo_get_bar: * @foo: blah blah blah * * <!-- Returns: says it all --> * * Returns: blah blah blah */ @@ +3279,5 @@ > +/** > + * dbus_g_method_invocation_get_g_connection: > + * @context: the method context > + * > + * Returns: the @DBusGConnection from which the method was called. I'd like a (transfer none) annotation here - dbus-glib isn't introspectable anyway, but it's useful information for gtk-doc too.
Created attachment 68264 [details] [review] Add accessor to return the DBusGConnection that a DBusGMethodInvocation was invoked on
Fixed in git for 0.102, thanks
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.