After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 787902 - notificationDaemon: Guard against invalid D-Bus object paths
notificationDaemon: Guard against invalid D-Bus object paths
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2017-09-19 15:33 UTC by Mario Sánchez Prada
Modified: 2017-09-25 14:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
notificationDaemon: Guard against invalid D-Bus object paths (2.04 KB, patch)
2017-09-19 15:34 UTC, Mario Sánchez Prada
none Details | Review
1. notificationDaemon: Consider hyphens for app ID to object path translations (1.10 KB, patch)
2017-09-22 12:59 UTC, Mario Sánchez Prada
accepted-commit_now Details | Review
2. notificationDaemon: Guard against invalid D-Bus object paths (1.64 KB, patch)
2017-09-22 13:00 UTC, Mario Sánchez Prada
needs-work Details | Review

Description Mario Sánchez Prada 2017-09-19 15:33:09 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
Comment 1 Mario Sánchez Prada 2017-09-19 15:34:41 UTC
Created attachment 360057 [details] [review]
notificationDaemon: Guard against invalid D-Bus object paths

Attaching patch (by Krzesimir Nowak)
Comment 2 Florian Müllner 2017-09-19 15:37:08 UTC
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
Comment 3 Krzesimir Nowak 2017-09-19 15:40:50 UTC
I must have forgotten to try to upstream this patch. Sorry about that.
Comment 4 Mario Sánchez Prada 2017-09-21 14:46:14 UTC
Need to deal with some things downstream, but will adapt this one soon and propose new patches. Thanks
Comment 5 Mario Sánchez Prada 2017-09-22 12:59:59 UTC
Created attachment 360257 [details] [review]
1. notificationDaemon: Consider hyphens for app ID to object path translations
Comment 6 Mario Sánchez Prada 2017-09-22 13:00:17 UTC
Created attachment 360258 [details] [review]
2. notificationDaemon: Guard against invalid D-Bus object paths
Comment 7 Florian Müllner 2017-09-22 16:41:42 UTC
Review of attachment 360257 [details] [review]:

LGTM
Comment 8 Florian Müllner 2017-09-22 16:41:51 UTC
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 ...
Comment 9 Mario Sánchez Prada 2017-09-25 14:59:49 UTC
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