System D-Bus does not allow punching out ownership with conf files

前端 未结 2 1088
迷失自我
迷失自我 2021-01-05 01:46

I am trying to create a daemon service that runs on the system bus where the permissions for sending and receiving from this service should be completely open to anybody. (S

相关标签:
2条回答
  • 2021-01-05 02:18

    I did the same solution as the accepted answer but I also got it to work with this alternative.

    I noticed that in my system.conf file, there is this note:

    For local configuration changes, create a file system-local.conf or files matching system.d/*.conf in the same directory as this one, with a element containing configuration directives. These directives can override D-Bus or OS defaults.

    Instead of putting a <name.of.my.dbus.service>.conf under system.d/, I was able to make it work by creating a system-local.conf in the same directory as the system.conf, with the contents like this:

    <!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
     "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
    <busconfig>
      <policy context="default">
        <allow own="dbus.my.own.service"/>
      </policy>
    </busconfig>
    
    0 讨论(0)
  • 2021-01-05 02:26

    I finally found the issue. When Dbus looks for configuration files for punching out permissions (like ownerships) the file not only must be in system.d/ but it must also end in .conf.

    My configuration file "org.dbus.arduino" should have been "org.dbus.arduino.conf". I removed the code from system.conf. Confirmed I no longer had permissions, created a configuration file at "system.d/org.dbus.arduino.conf", I was granted permissions. I then attempted to rename the file to just "org.dbus.arduino" and confirmed the permissions were denied.

    0 讨论(0)
提交回复
热议问题