bus1 / dbus-broker

Linux D-Bus Message Broker
https://github.com/bus1/dbus-broker/wiki
Apache License 2.0
675 stars 78 forks source link

hypen character is not escaped in systemd service name #230

Closed davidedmundson closed 4 years ago

davidedmundson commented 4 years ago

"-" is a perfectly valid character for a DBus name but it has a special meaning inside systemd.

[D-BUS Service]
Name=net.dave.foo-bar
Exec=/bin/someapp 

Registers dbus-:1.2-net.dave.foo-bar@1.service

It should be

dbus-:1.2-net.dave.foo\x2dbar@1.service

relevant line is service.c:327:

    r = asprintf(&unit, "dbus-%s-%s@%"PRIu64".service", unique_name, service->name, service->instance++);
dvdhrm commented 4 years ago

I created a PR #231 that should fix this. Thanks a lot for the report!

davidedmundson commented 4 years ago

Thanks a lot for the report!

No Problem.

It's pretty minor for now, but FYI the reason I was looking was because I'm investigating slowly getting more parts to follow: https://systemd.io/DESKTOP_ENVIRONMENTS/ where the cgroup name will start carrying semantic value.

dvdhrm commented 4 years ago

This is fixed and merged. I think I will quite likely prep a release this week, so this should hit distros pretty soon. Again, thanks a lot!