aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkremlin- <ian@kremlin.cc>2014-06-05 11:36:18 +0800
committerkremlin- <ian@kremlin.cc>2014-06-05 11:36:18 +0800
commit4e9c115ff17fa613448efdd70be746045accafb0 (patch)
treef158109a7685ad691c644b76a7941d78b311e10a
parentff1030d487f7ce362452dac0d5c6e06248b0a38b (diff)
downloadsystembsd-4e9c115ff17fa613448efdd70be746045accafb0.tar
systembsd-4e9c115ff17fa613448efdd70be746045accafb0.tar.gz
systembsd-4e9c115ff17fa613448efdd70be746045accafb0.tar.bz2
systembsd-4e9c115ff17fa613448efdd70be746045accafb0.tar.lz
systembsd-4e9c115ff17fa613448efdd70be746045accafb0.tar.xz
systembsd-4e9c115ff17fa613448efdd70be746045accafb0.tar.zst
systembsd-4e9c115ff17fa613448efdd70be746045accafb0.zip
divorce introspect xml to conf/ file, rm hostnamed.h, update system bus config file to be more secure..
-rw-r--r--conf/hostnamed-ispect.xml25
-rw-r--r--src/interfaces/hostnamed/hostnamed.c1
-rw-r--r--src/interfaces/hostnamed/hostnamed.h78
3 files changed, 25 insertions, 79 deletions
diff --git a/conf/hostnamed-ispect.xml b/conf/hostnamed-ispect.xml
new file mode 100644
index 0000000..fbf2d71
--- /dev/null
+++ b/conf/hostnamed-ispect.xml
@@ -0,0 +1,25 @@
+<!-- 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>
diff --git a/src/interfaces/hostnamed/hostnamed.c b/src/interfaces/hostnamed/hostnamed.c
index f41892d..3002336 100644
--- a/src/interfaces/hostnamed/hostnamed.c
+++ b/src/interfaces/hostnamed/hostnamed.c
@@ -1,5 +1,4 @@
#include <gio/gio.h>
-#include "hostnamed.h"
GMainLoop *loop;
GDBusNodeInfo *spect_data;
diff --git a/src/interfaces/hostnamed/hostnamed.h b/src/interfaces/hostnamed/hostnamed.h
deleted file mode 100644
index 6bc1478..0000000
--- a/src/interfaces/hostnamed/hostnamed.h
+++ /dev/null
@@ -1,78 +0,0 @@
-#include <gio/gio.h>
-
-static const gchar SYSTEMD_HOSTNAMED_XML[] =
- "<!DOCTYPE node PUBLIC '-//freedesktop//DTD D-BUS Object Introspection 1.0//EN'"
- "'http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd'>"
- "<node>"
- " <interface name='org.freedesktop.DBus.Peer'>"
- " <method name='Ping'/>"
- " <method name='GetMachineId'>"
- " <arg type='s' name='machine_uuid' direction='out'/>"
- " </method>"
- " </interface>"
- " <interface name='org.freedesktop.DBus.Introspectable'>"
- " <method name='Introspect'>"
- " <arg name='data' type='s' direction='out'/>"
- " </method>"
- " </interface>"
- " <interface name='org.freedesktop.DBus.Properties'>"
- " <method name='Get'>"
- " <arg name='interface' direction='in' type='s'/>"
- " <arg name='property' direction='in' type='s'/>"
- " <arg name='value' direction='out' type='v'/>"
- " </method>"
- " <method name='GetAll'>"
- " <arg name='interface' direction='in' type='s'/>"
- " <arg name='properties' direction='out' type='a{sv}'/>"
- " </method>"
- " <method name='Set'>"
- " <arg name='interface' direction='in' type='s'/>"
- " <arg name='property' direction='in' type='s'/>"
- " <arg name='value' direction='in' type='v'/>"
- " </method>"
- " <signal name='PropertiesChanged'>"
- " <arg type='s' name='interface'/>"
- " <arg type='a{sv}' name='changed_properties'/>"
- " <arg type='as' name='invalidated_properties'/>"
- " </signal>"
- " </interface>"
- " <interface name='org.freedesktop.hostname1'>"
- " <property name='Hostname' type='s' access='read'>"
- " <annotation name='org.freedesktop.DBus.Property.EmitsChangedSignal' value='false'/>"
- " </property>"
- " <property name='StaticHostname' type='s' access='read'>"
- " </property>"
- " <property name='PrettyHostname' type='s' access='read'>"
- " </property>"
- " <property name='IconName' type='s' access='read'>"
- " </property>"
- " <property name='Chassis' type='s' access='read'>"
- " </property>"
- " <property name='OperatingSystemPrettyName' type='s' access='read'>"
- " <annotation name='org.freedesktop.DBus.Property.EmitsChangedSignal' value='const'/>"
- " </property>"
- " <property name='OperatingSystemCPEName' type='s' access='read'>"
- " <annotation name='org.freedesktop.DBus.Property.EmitsChangedSignal' value='const'/>"
- " </property>"
- " <method name='SetHostname'>"
- " <arg type='s' direction='in'/>"
- " <arg type='b' direction='in'/>"
- " </method>"
- " <method name='SetStaticHostname'>"
- " <arg type='s' direction='in'/>"
- " <arg type='b' direction='in'/>"
- " </method>"
- " <method name='SetPrettyHostname'>"
- " <arg type='s' direction='in'/>"
- " <arg type='b' direction='in'/>"
- " </method>"
- " <method name='SetIconName'>"
- " <arg type='s' direction='in'/>"
- " <arg type='b' direction='in'/>"
- " </method>"
- " <method name='SetChassis'>"
- " <arg type='s' direction='in'/>"
- " <arg type='b' direction='in'/>"
- " </method>"
- " </interface>"
- "</node>";