diff options
author | kremlin <ian@kremlin.cc> | 2014-06-08 09:04:10 +0800 |
---|---|---|
committer | kremlin <ian@kremlin.cc> | 2014-06-08 09:04:10 +0800 |
commit | f4d347617c6f947246bad12d3fdb48ce93e26e5a (patch) | |
tree | c70c1bf76d0b77f3e0cd2eebb92837f85cba7753 | |
parent | e1ab1483144fea7ca4191ed5d443cec9d86c3a67 (diff) | |
download | systembsd-f4d347617c6f947246bad12d3fdb48ce93e26e5a.tar systembsd-f4d347617c6f947246bad12d3fdb48ce93e26e5a.tar.gz systembsd-f4d347617c6f947246bad12d3fdb48ce93e26e5a.tar.bz2 systembsd-f4d347617c6f947246bad12d3fdb48ce93e26e5a.tar.lz systembsd-f4d347617c6f947246bad12d3fdb48ce93e26e5a.tar.xz systembsd-f4d347617c6f947246bad12d3fdb48ce93e26e5a.tar.zst systembsd-f4d347617c6f947246bad12d3fdb48ce93e26e5a.zip |
syncing...
-rw-r--r-- | src/interfaces/hostnamed/hostnamed.c | 2 | ||||
-rw-r--r-- | src/main.h | 51 |
2 files changed, 52 insertions, 1 deletions
diff --git a/src/interfaces/hostnamed/hostnamed.c b/src/interfaces/hostnamed/hostnamed.c index 0559b8b..b2f9684 100644 --- a/src/interfaces/hostnamed/hostnamed.c +++ b/src/interfaces/hostnamed/hostnamed.c @@ -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 index 0000000..2fd39ea --- /dev/null +++ b/src/main.h @@ -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>"; |