syncing...
authorkremlin <ian@kremlin.cc>
Sun, 8 Jun 2014 01:04:10 +0000 (21:04 -0400)
committerkremlin <ian@kremlin.cc>
Sun, 8 Jun 2014 01:04:10 +0000 (21:04 -0400)
src/interfaces/hostnamed/hostnamed.c
src/main.h [new file with mode: 0644]

index 0559b8b740bc49fd01803b712c3dd54b35f4d452..b2f96841cb148a40c824faace565215309e8bd19 100644 (file)
@@ -95,7 +95,7 @@ static void on_name_lost(GDBusConnection *conn,
                                                 const gchar *name,
                                                 gpointer user_data) {
 
-       g_print("lost name %s, exiting...\n", name);
+       g_print("lost name %s, exiting...", name);
        //TODO exit through g_main_loop properly...
        exit(0);
 }
diff --git a/src/main.h b/src/main.h
new file mode 100644 (file)
index 0000000..2fd39ea
--- /dev/null
@@ -0,0 +1,51 @@
+#include <gio/gio.h>
+
+#ifdef  NO BUILTIN XML
+//TODO install conf
+#endif
+
+#ifndef NO_BUILTIN_XML
+gchar **hostnamed_config_xml =
+"<!DOCTYPE busconfig PUBLIC"
+"         \"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN\""
+"         \"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd\">"
+"<busconfig>"
+"   <!-- Only members of 'wheel' and user 'daemon' may set hostnames -->"
+"   <policy group=\"wheel\">"
+"       <allow own=\"org.freedesktop.hostname1\"/>"
+"       <allow send_destination=\"org.freedesktop.hostname1\"/>"
+"       <allow receive_sender=\"org.freedesktop.hostname1\"/>"
+"   </policy>"
+"   <policy user=\"daemon\">"
+"       <allow own=\"org.freedesktop.hostname1\"/>"
+"       <allow send_destination=\"org.freedesktop.hostname1\"/>"
+"       <allow receive_sender=\"org.freedesktop.hostname1\"/>"
+"    </policy>"
+"</busconfig>";
+
+gchar **hostnamed_ispect_xml =
+"<!-- Taken from Gentoo Linux's OpenRC settingsd -->"
+"<node name=\"/org/freedesktop/hostname1\">"
+"    <interface name=\"org.freedesktop.hostname1\">"
+"        <method name=\"SetHostname\">"
+"            <arg direction=\"in\" type=\"s\" name=\"name\"/>"
+"            <arg direction=\"in\" type=\"b\" name=\"user_interaction\"/>"
+"        </method>"
+"        <method name=\"SetStaticHostname\">"
+"            <arg direction=\"in\" type=\"s\" name=\"name\"/>"
+"            <arg direction=\"in\" type=\"b\" name=\"user_interaction\"/>"
+"        </method>"
+"        <method name=\"SetPrettyHostname\">"
+"            <arg direction=\"in\" type=\"s\" name=\"name\"/>"
+"            <arg direction=\"in\" type=\"b\" name=\"user_interaction\"/>"
+"        </method>"
+"        <method name=\"SetIconName\">"
+"            <arg direction=\"in\" type=\"s\" name=\"name\"/>"
+"            <arg direction=\"in\" type=\"b\" name=\"user_interaction\"/>"
+"        </method>"
+"        <property name=\"Hostname\" type=\"s\" access=\"read\"/>"
+"        <property name=\"StaticHostname\" type=\"s\" access=\"read\"/>"
+"        <property name=\"PrettyHostname\" type=\"s\" access=\"read\"/>"
+"        <property name=\"IconName\" type=\"s\" access=\"read\"/>"
+"    </interface>"
+"</node>";