bus1 / dbus-broker

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

Invalid file in 'includedir' causes entire launch to fail #335

Closed Aaron1011 closed 5 months ago

Aaron1011 commented 6 months ago

I accidentally ended up with an empty file in an includedir directory (/usr/share/dbus-1/system.d on Arch Linux). This resulted in dbus-broker-launch exiting with the following error:

Jan 11 15:50:51 ArchLaptop dbus-broker-launch[561]: Invalid XML in /usr/share/dbus-1/system.d/sddm_org.freedesktop.DisplayManager.conf +1: no element found
Jan 11 15:50:51 ArchLaptop dbus-broker-launch[561]: ERROR run @ ../dbus-broker-35/src/launch/main.c +152: Return code 1
Jan 11 15:50:51 ArchLaptop dbus-broker-launch[561]:       main @ ../dbus-broker-35/src/launch/main.c +178
Jan 11 15:50:51 ArchLaptop dbus-broker-launch[561]: Exiting due to fatal error: -131

Unfortunately, this rendered my system almost unuseable until it was fixed - in particular, tools like systemctl need DBus to be running.

It would be useful to have a config option to log an error and continue running when an invalid file in found in an includedir.

dvdhrm commented 6 months ago

An invalid configuration might be an accidental typo. If we silently ignore the file, we would possibly introduce security problems due to not picking up important permission rules from the file, and thus lead to a vulnerable system.

Hence, dbus-broker refuses to start with invalid configuration.

Aaron1011 commented 6 months ago

What about a config option (disabled by default) which explicitly acknowledges the risks - something like insecure-ignore-invalid-config?

dvdhrm commented 6 months ago

I am sorry, but this is not a direction we want to take.

dvdhrm commented 5 months ago

I am closing this, as this is an explicit policy decision of dbus-broker. If you prefer a change in policy, please open an issue and elaborate on how you envision this to work.

Thanks for the report!