diff options
-rw-r--r-- | hacks/hostnamed-dbus.conf | 10 | ||||
-rwxr-xr-x | hacks/punch_config.sh | 8 | ||||
-rwxr-xr-x | hacks/unpunch_config.sh | 7 | ||||
-rw-r--r-- | src/interfaces/hostnamed/hostnamed.c | 2 |
4 files changed, 26 insertions, 1 deletions
diff --git a/hacks/hostnamed-dbus.conf b/hacks/hostnamed-dbus.conf new file mode 100644 index 0000000..c84c0f3 --- /dev/null +++ b/hacks/hostnamed-dbus.conf @@ -0,0 +1,10 @@ +<!-- if i am in /etc/dbus-1/system.d/ you should probably delete me immediately --> + +<!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="org.freedesktop.hostname1"/> + <allow send_destination="org.freedesktop.hostname1"/> + <allow receive_sender="org.freedesktop.hostname1"/> + </policy> +</busconfig> diff --git a/hacks/punch_config.sh b/hacks/punch_config.sh new file mode 100755 index 0000000..611250d --- /dev/null +++ b/hacks/punch_config.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +# sticks our config for hostnamed (which needs to use the system bus) +# in place. and restarts dbus-daemon will be replaced by a more elegant, +# not-hack in the future + +cp $(dirname "$(readlink -f "$0")")/hostnamed-dbus.conf /etc/dbus-1/system.d/hostnamed-dbus.conf +/etc/rc.d/dbus_daemon reload >> /dev/null diff --git a/hacks/unpunch_config.sh b/hacks/unpunch_config.sh new file mode 100755 index 0000000..076c353 --- /dev/null +++ b/hacks/unpunch_config.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# unsticks our config for hostnamed (which needs to use the system bus) +# and restarts dbus + +rm /etc/dbus-1/system.d/hostnamed-dbus.conf +/etc/rc.d/dbus_daemon reload >> /dev/null diff --git a/src/interfaces/hostnamed/hostnamed.c b/src/interfaces/hostnamed/hostnamed.c index 114ad10..4b326a1 100644 --- a/src/interfaces/hostnamed/hostnamed.c +++ b/src/interfaces/hostnamed/hostnamed.c @@ -84,7 +84,6 @@ static void on_bus_acquired(GDBusConnection *conn, NULL, NULL, NULL); - g_assert(reg_id > 0); } static void on_name_acquired(GDBusConnection *conn, @@ -99,6 +98,7 @@ static void on_name_lost(GDBusConnection *conn, gpointer user_data) { g_print("lost name %s, exiting...\n", name); + g_print("you might need to run hacks/punch_config.sh\n"); g_main_loop_quit(loop); } |