added scripts to place config files, added a note in source about that
authorkremlin <ian@kremlin.cc>
Mon, 2 Jun 2014 22:38:44 +0000 (17:38 -0500)
committerkremlin <ian@kremlin.cc>
Mon, 2 Jun 2014 22:38:44 +0000 (17:38 -0500)
hacks/hostnamed-dbus.conf [new file with mode: 0644]
hacks/punch_config.sh [new file with mode: 0755]
hacks/unpunch_config.sh [new file with mode: 0755]
src/interfaces/hostnamed/hostnamed.c

diff --git a/hacks/hostnamed-dbus.conf b/hacks/hostnamed-dbus.conf
new file mode 100644 (file)
index 0000000..c84c0f3
--- /dev/null
@@ -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 (executable)
index 0000000..611250d
--- /dev/null
@@ -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 (executable)
index 0000000..076c353
--- /dev/null
@@ -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
index 114ad10043d138b85cf143b7ad39a86976b9342f..4b326a1400bc29d2d883e8797b0317861f903ff7 100644 (file)
@@ -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);
 }