Skip to content

Commit

Permalink
fix: remove send_destination_prefix attribute
Browse files Browse the repository at this point in the history
Remove the use of the send_destination_prefix attribute from yggd's
busconfig policy. Instead, each worker must install their own busconfig
policy. Update the echo worker to demonstrate this.

Signed-off-by: Link Dupont <[email protected]>
  • Loading branch information
subpop committed May 8, 2023
1 parent b1afe1d commit 454370c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
4 changes: 0 additions & 4 deletions data/dbus/yggd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
<allow own="com.redhat.Yggdrasil1.Dispatcher1"/>
<allow own_prefix="com.redhat.Yggdrasil1.Worker1"/>

<!-- Only root can send messages to the Worker1 interface. -->
<allow send_destination_prefix="com.redhat.Yggdrasil1.Worker1" send_interface="com.redhat.Yggdrasil1.Worker1"/>
<allow send_destination_prefix="com.redhat.Yggdrasil1.Worker1" send_interface="org.freedesktop.DBus.Properties"/>

<!-- Only root can send messages to Dispatcher1 destination. -->
<allow send_destination="com.redhat.Yggdrasil1.Dispatcher1"/>

Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project('yggdrasil',

go = find_program('go')

dbus = dependency('dbus-1', version: '>=1.14')
dbus = dependency('dbus-1', version: '>=1.12')
systemd = dependency('systemd')
bash_completion = dependency('bash-completion')

Expand Down
13 changes: 13 additions & 0 deletions worker/echo/com.redhat.Yggdrasil1.Worker1.echo.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE busconfig PUBLIC
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"https://dbus.freedesktop.org/doc/busconfig.dtd">
<busconfig>
<policy user="root">
<!-- Only root can send messages to the Worker1.echo destination. -->
<allow send_destination="com.redhat.Yggdrasil1.Worker1.echo" send_interface="com.redhat.Yggdrasil1.Worker1"/>
<allow send_destination="com.redhat.Yggdrasil1.Worker1.echo" send_interface="org.freedesktop.DBus.Properties"/>
<allow send_destination="com.redhat.Yggdrasil1.Worker1.echo" send_interface="org.freedesktop.DBus.Introspectable"/>
</policy>
</busconfig>
4 changes: 4 additions & 0 deletions worker/echo/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ configure_file(
install: true,
install_dir: dbus.get_variable(pkgconfig: 'system_bus_services_dir')
)

install_data('com.redhat.Yggdrasil1.Worker1.echo.conf',
install_dir: join_paths(dbus.get_variable(pkgconfig: 'datadir'), 'dbus-1', 'system.d')
)

0 comments on commit 454370c

Please sign in to comment.