GNOME Bugzilla – Bug 787902
notificationDaemon: Guard against invalid D-Bus object paths
Last modified: 2017-09-25 14:59:49 UTC
When making any D-Bus call through the GDBus' proxy wrapper with an invalid D-Bus object path, gnome-shell hangs. We may get an invalid D-Bus object path when deducing it from the application ID, since format of the D-Bus object path is stricter than the format of the application ID. Namely - the former does not allow hyphens. So for an application with an ID like org.gtk.bloatpad-gtk we get an invalid D-Bus object path like /org/gtk/bloatpad-gtk. From a patch we currently carry around on Endless downstream: https://github.com/endlessm/gnome-shell/commit/6b7113bca03ef520967759851c6fc3167c631d66
Created attachment 360057 [details] [review] notificationDaemon: Guard against invalid D-Bus object paths Attaching patch (by Krzesimir Nowak)
Review of attachment 360057 [details] [review]: Makes sense to me, but please split between: - fixing the app ID => object path translation - guarding against invalid object paths
I must have forgotten to try to upstream this patch. Sorry about that.
Need to deal with some things downstream, but will adapt this one soon and propose new patches. Thanks
Created attachment 360257 [details] [review] 1. notificationDaemon: Consider hyphens for app ID to object path translations
Created attachment 360258 [details] [review] 2. notificationDaemon: Guard against invalid D-Bus object paths
Review of attachment 360257 [details] [review]: LGTM
Review of attachment 360258 [details] [review]: Code looks good, but the commit message needs some work: "We may get an invalid D-Bus object path when deducing it from the application ID, since format of the D-Bus object path is stricter than the format of the application ID. Namely - the former does not allow hyphens." This is fixed by the previous commit, so no longer applies "So for an application with an ID like org.gtk.bloatpad-gtk we get an invalid D-Bus object path like /org/gtk/bloatpad_gtk." /org/gtk/bloadpad_gtk is a valid object path :-) I'd say just take out the middle paragraph ...
Thanks for the comments, Florian. I pushed both patches after addressing the comment in the second one: https://git.gnome.org/browse/gnome-shell/commit/?id=ce7ff27c0ce100338b472b42068fd9808fdcf27c https://git.gnome.org/browse/gnome-shell/commit/?id=1ef8722c52d8e88041b3af61c0ee082c2b40dee7