Bug 99876

Summary: prefer recommended service naming on collision
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:    
Attachments: activation: Add support for enforcing strict naming on .service files

Description Simon McVittie 2017-02-20 17:07:24 UTC
As noted in Bug #99873, many session services are named in a non-canonical way.

One thing we can do to make this better is: if a directory in the search path contains a canonically-named service and a non-canonically-named service for the same well-known bus name, we should prefer the canonically-named one, instead of just taking whichever comes first in readdir() order.
Comment 1 Philip Withnall 2017-02-20 17:44:14 UTC
To be clear, you mean to order by (search path, is canonically named?) rather than (is canonically named?, search path), right? The current behaviour is (search path, random).
Comment 2 Simon McVittie 2017-02-20 17:55:21 UTC
(In reply to Philip Withnall from comment #1)
> To be clear, you mean to order by (search path, is canonically named?)
> rather than (is canonically named?, search path), right? The current
> behaviour is (search path, random).

Yes. A non-canonically-named service in /usr/local should still beat a canonically-named service in /usr.
Comment 3 Simon McVittie 2017-02-20 19:31:36 UTC
Created attachment 129772 [details] [review]
activation: Add support for enforcing strict naming on  .service files

This is done on a per-directory basis.

The use of the BusContext here means we have to make the activation
test a little more realistic, by providing a non-NULL BusContext.

---

Move BusServiceDirFlags in BusServiceDirectory from previous commit to here.

Add bug references. Log a _dbus_verbose() for Bug #99873 for now.
Comment 4 Simon McVittie 2017-02-20 19:32:21 UTC
Comment on attachment 129772 [details] [review]
activation: Add support for enforcing strict naming on  .service files

Sigh, wrong bug.
Comment 5 GitLab Migration User 2018-10-12 21:30:16 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/169.

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.