Bug 99873

Summary: consider warning when session services have the wrong name
Product: dbus Reporter: Simon McVittie <smcv>
Component: coreAssignee: D-Bus Maintainers <dbus>
Status: RESOLVED MOVED QA Contact: D-Bus Maintainers <dbus>
Severity: enhancement    
Priority: medium    
Version: git master   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on: 99825    
Bug Blocks:    

Description Simon McVittie 2017-02-20 16:41:21 UTC
Best practice for D-Bus session services is to define the service com.example.Foo in a file named com.example.Foo.service. This ensures that it is unambiguous which one is started: the one that is first in directory search order (this is not 100% reliable until one of the patches from Bug #99825 lands).

dbus-daemon could warn if a service is encountered that does not satisfy that constraint. However, this is currently wrong in a lot of software <https://lintian.debian.org/tags/dbus-session-service-wrong-name.html> so we should probably get some of those fixed first.

The cost of obeying that constraint is that if two software packages are deliberately providing implementations of the same well-known bus name, they will have file conflicts. However, this does not seem a whole lot worse than the current situation, where whichever one appears first in readdir() order is chosen, which I'm fairly sure is not what the software author intended.
Comment 1 Simon McVittie 2017-02-20 16:41:37 UTC
Here is a brief survey of packages in Debian that would provoke these warnings. In each case the first name is what we want and the second is what we saw.

---- Deliberately colliding ----

apper: org.freedesktop.PackageKit.service usr/share/dbus-1/services/kde-org.freedesktop.PackageKit.service

caja-common: org.freedesktop.FileManager1.service usr/share/dbus-1/services/org.mate.freedesktop.FileManager1.service
dolphin: org.freedesktop.FileManager1.service usr/share/dbus-1/services/org.kde.dolphin.FileManager1.service
nemo: org.freedesktop.FileManager1.service usr/share/dbus-1/services/org.nemo.freedesktop.FileManager1.service
    If we try to activate o.fd.FM1.service with more than one of these installed, we will get a randomly chosen implementation. This does not seem practically useful.

dunst: org.freedesktop.Notifications.service usr/share/dbus-1/services/org.knopwob.dunst.service
mate-notification-daemon: org.freedesktop.Notifications.service usr/share/dbus-1/services/org.freedesktop.mate.Notifications.service
xfce4-notifyd: org.freedesktop.Notifications.service usr/share/dbus-1/services/org.xfce.xfce4-notifyd.Notifications.service
    Similarly, if we try to activate o.fd.N.service with more than one of these installed, we will get a randomly chosen implementation.

---- Potentially deliberately colliding ----

plasma-workspace: org.kde.kuiserver.service usr/share/dbus-1/services/kf5_org.kde.kuiserver.service
    This looks like it might be intended to be parallel-installed with KDE 4?

tumbler: org.freedesktop.thumbnails.Cache1.service usr/share/dbus-1/services/org.xfce.Tumbler.Cache1.service
tumbler: org.freedesktop.thumbnails.Manager1.service usr/share/dbus-1/services/org.xfce.Tumbler.Manager1.service
tumbler: org.freedesktop.thumbnails.Thumbnailer1.service usr/share/dbus-1/services/org.xfce.Tumbler.Thumbnailer1.service
tumbler: org.freedesktop.thumbnails.Cache1.service usr/share/dbus-1/services/org.xfce.Tumbler.Cache1.service
tumbler: org.freedesktop.thumbnails.Manager1.service usr/share/dbus-1/services/org.xfce.Tumbler.Manager1.service
tumbler: org.freedesktop.thumbnails.Thumbnailer1.service usr/share/dbus-1/services/org.xfce.Tumbler.Thumbnailer1.service
    Might be intended to be parallel-installed with other thumbnailers?

---- "Just a bug" ----

blueman: org.blueman.Applet.service usr/share/dbus-1/services/blueman-applet.service
caribou-antler: org.gnome.Caribou.Keyboard.service usr/share/dbus-1/services/org.gnome.Caribou.Antler.service
certmonger: org.fedorahosted.certmonger.service usr/share/dbus-1/services/certmonger.service
command-runner-applet: org.gnome.panel.applet.CommandRunnerAppletFactory.service usr/share/dbus-1/services/CommandRunnerAppletFactory.service
contractor: org.elementary.Contractor.service usr/share/dbus-1/services/org.elementary.contractor.service
epiphany-browser: org.gnome.EpiphanySearchProvider.service usr/share/dbus-1/services/org.gnome.Epiphany.service
evolution-data-server-common: org.gnome.evolution.dataserver.AddressBook9.service usr/share/dbus-1/services/org.gnome.evolution.dataserver.AddressBook.service
evolution-data-server-common: org.gnome.evolution.dataserver.Calendar7.service usr/share/dbus-1/services/org.gnome.evolution.dataserver.Calendar.service
evolution-data-server-common: org.gnome.evolution.dataserver.Sources5.service usr/share/dbus-1/services/org.gnome.evolution.dataserver.Sources.service
evolution-data-server-common: org.gnome.evolution.dataserver.UserPrompter0.service usr/share/dbus-1/services/org.gnome.evolution.dataserver.UserPrompter.service
file-roller: org.gnome.ArchiveManager1.service usr/share/dbus-1/services/org.gnome.FileRoller.ArchiveManager1.service
    org.gnome.ArchiveManager1.service usr/share/dbus-1/services/org.gnome.FileRoller.ArchiveManager1.service
gnome-sushi: org.gnome.NautilusPreviewer.service usr/share/dbus-1/services/org.gnome.Sushi.service
hamster-applet: org.gnome.Hamster.WindowServer.service usr/share/dbus-1/services/org.gnome.hamster.Windows.service
jackd2: org.jackaudio.service.service usr/share/dbus-1/services/org.jackaudio.service
kaccessible: org.kde.kaccessibleapp.service usr/share/dbus-1/services/org.kde.kaccessible.service
libkf5screen-bin: org.kde.KScreen.service usr/share/dbus-1/services/org.kde.kscreen.service
libsocialweb-service: com.meego.libsocialweb.service usr/share/dbus-1/services/libsocialweb.service
obex-data-server: org.openobex.service usr/share/dbus-1/services/obex-data-server.service
presage-dbus: org.gnome.presage.beta.service usr/share/dbus-1/services/org.gnome.presage.service
tictactoe-ng: org.gnome.Empathy.DTubeHandler.org_gnome_TicTacToe.service usr/share/dbus-1/services/org.gnome.Empathy.DTubeHandler.org.gnome.TicTacToe.service
Comment 2 GitLab Migration User 2018-10-12 21:30:10 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/dbus/dbus/issues/167.

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.