aboutsummaryrefslogtreecommitdiff
path: root/dbus
diff options
context:
space:
mode:
Diffstat (limited to 'dbus')
-rw-r--r--dbus/org.torproject.tlsdate.conf.in31
-rw-r--r--dbus/org.torproject.tlsdate.service3
-rw-r--r--dbus/org.torproject.tlsdate.xml42
3 files changed, 76 insertions, 0 deletions
diff --git a/dbus/org.torproject.tlsdate.conf.in b/dbus/org.torproject.tlsdate.conf.in
new file mode 100644
index 0000000..80c83c1
--- /dev/null
+++ b/dbus/org.torproject.tlsdate.conf.in
@@ -0,0 +1,31 @@
+<!DOCTYPE busconfig PUBLIC
+ "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+ <!-- Only certain user can own the tlsdated service -->
+ <policy user="@UNPRIV_USER@">
+ <allow own="org.torproject.tlsdate"/>
+ </policy>
+
+ <!-- Allow anyone in the given group to invoke methods -->
+ <policy group="@DBUS_CLIENT_GROUP@">
+ <allow send_destination="org.torproject.tlsdate"
+ send_interface="org.torproject.tlsdate"
+ send_member="LastSyncInfo"/>
+ <allow send_destination="org.torproject.tlsdate"
+ send_interface="org.torproject.tlsdate"
+ send_member="SetTime"/>
+ <allow send_destination="org.torproject.tlsdate"
+ send_interface="org.torproject.tlsdate"
+ send_member="CanSetTime"/>
+ </policy>
+
+ <!-- Disallow anyone to invoke methods on tlsdated interface -->
+ <policy context="default">
+ <deny send_interface="org.torproject.tlsdate" />
+ <allow send_destination="org.torproject.tlsdate"
+ send_interface="org.torproject.tlsdate"
+ send_member="LastSyncInfo"/>
+ </policy>
+</busconfig>
diff --git a/dbus/org.torproject.tlsdate.service b/dbus/org.torproject.tlsdate.service
new file mode 100644
index 0000000..36ee56d
--- /dev/null
+++ b/dbus/org.torproject.tlsdate.service
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.torproject.tlsdate
+Exec=/usr/bin/tlsdated
diff --git a/dbus/org.torproject.tlsdate.xml b/dbus/org.torproject.tlsdate.xml
new file mode 100644
index 0000000..2023494
--- /dev/null
+++ b/dbus/org.torproject.tlsdate.xml
@@ -0,0 +1,42 @@
+<!DOCTYPE node PUBLIC
+"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
+"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
+
+ <interface name="org.torproject.tlsdate">
+ <method name="SetTime">
+ <arg name="time" direction="in" type="x">
+ <doc:doc><doc:summary>The requested time to set the system clock to. It may be tested
+ with:
+ dbus-send --print-reply --system --dest=org.torproject.tlsdate --type=method_call \
+ /org/torproject/tlsdate org.torproject.tlsdate.SetTime int64:12345678
+ </doc:summary></doc:doc>
+ </arg>
+ <arg name="code" direction="out" type="u">
+ <doc:doc><doc:summary>Returns success or failure via an enum:
+ OK:0, Bad value:1, Not allowed:2, Bad call format:3
+ </doc:summary></doc:doc>
+ </arg>
+ </method>
+ <method name="CanSetTime">
+ <arg name="code" direction="out" type="b">
+ <doc:doc><doc:summary>Returns TRUE is SetTime is allowed.
+ </doc:summary></doc:doc>
+ </arg>
+ </method>
+ <method name="LastSyncInfo">
+ <arg name="network_synchronized" direction="out" type="b">
+ <doc:doc><doc:summary>Whether the time is rooted in a network synchronization source since
+ fallback to "system-clock" happens at steady state intervals.
+ </doc:summary></doc:doc>
+ </arg>
+ <arg name="source" direction="out" type="s">
+ <doc:doc><doc:summary>Name of the last source</doc:summary></doc:doc>
+ </arg>
+ <arg name="time" direction="out" type="x">
+ <doc:doc><doc:summary>Last sync time</doc:summary></doc:doc>
+ </arg>
+ </method>
+
+ </interface>
+</node>