<!-- dbus 系统总线配置（NDI/avahi 专用，随包部署于 /tmp/avahi/）：
     由 dbus 官方 system.conf 精简合并而来——去掉 service 激活/包含目录等未用机制，
     并将 avahi-dbus.conf 的策略内联，单文件即完整配置。
     注意 <listen> 的 socket 路径是 libdbus 客户端编译期默认值，不可改动。 -->
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>

  <type>system</type>
  <user>root</user>
  <fork/>
  <pidfile>/tmp/var/run/dbus/pid</pidfile>
  <syslog/>
  <auth>EXTERNAL</auth>
  <listen>unix:path=/tmp/var/run/dbus/system_bus_socket</listen>

  <policy context="default">
    <allow user="*"/>
    <deny own="*"/>
    <deny send_type="method_call"/>
    <allow send_type="signal"/>
    <allow send_requested_reply="true" send_type="method_return"/>
    <allow send_requested_reply="true" send_type="error"/>
    <allow receive_type="method_call"/>
    <allow receive_type="method_return"/>
    <allow receive_type="error"/>
    <allow receive_type="signal"/>
    <allow send_destination="org.freedesktop.DBus"
           send_interface="org.freedesktop.DBus" />
    <allow send_destination="org.freedesktop.DBus"
           send_interface="org.freedesktop.DBus.Introspectable"/>
    <allow send_destination="org.freedesktop.DBus"
           send_interface="org.freedesktop.DBus.Properties"/>
  </policy>

  <!-- avahi 策略（原 etc/dbus-1/system.d/avahi-dbus.conf 内联） -->
  <policy user="root">
    <allow own="org.freedesktop.Avahi"/>
    <allow send_destination="org.freedesktop.Avahi"/>
    <allow receive_sender="org.freedesktop.Avahi"/>
  </policy>
  <policy context="default">
    <allow send_destination="org.freedesktop.Avahi"/>
    <allow receive_sender="org.freedesktop.Avahi"/>
    <deny send_destination="org.freedesktop.Avahi"
          send_interface="org.freedesktop.Avahi.Server" send_member="SetHostName"/>
  </policy>

</busconfig>
