This commit is contained in:
16
data/CMakeLists.txt
Normal file
16
data/CMakeLists.txt
Normal file
@ -0,0 +1,16 @@
|
||||
find_program(SED sed)
|
||||
|
||||
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/org.freedesktop.timedate1.service
|
||||
COMMAND ${SED} -e s|@LIBEXECDIR@|${CMAKE_INSTALL_FULL_LIBEXECDIR}| ${CMAKE_CURRENT_SOURCE_DIR}/org.freedesktop.timedate1.service.in > ${PROJECT_BINARY_DIR}/org.freedesktop.timedate1.service
|
||||
MAIN_DEPENDENCY org.freedesktop.timedate1.service.in
|
||||
VERBATIM)
|
||||
add_custom_target(service ALL DEPENDS ${PROJECT_BINARY_DIR}/org.freedesktop.timedate1.service)
|
||||
|
||||
install(FILES org.freedesktop.timedate1.xml
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/dbus-1/interfaces)
|
||||
install(FILES org.freedesktop.timedate1.policy
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/polkit-1/actions)
|
||||
install(FILES org.freedesktop.timedate1.conf
|
||||
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/dbus-1/system.d)
|
||||
install(FILES ${PROJECT_BINARY_DIR}/org.freedesktop.timedate1.service
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/dbus-1/system-services)
|
27
data/org.freedesktop.timedate1.conf
Normal file
27
data/org.freedesktop.timedate1.conf
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0"?> <!--*-nxml-*-->
|
||||
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||
|
||||
<!--
|
||||
This file is part of systemd.
|
||||
|
||||
systemd is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
-->
|
||||
|
||||
<busconfig>
|
||||
|
||||
<policy user="root">
|
||||
<allow own="org.freedesktop.timedate1"/>
|
||||
<allow send_destination="org.freedesktop.timedate1"/>
|
||||
<allow receive_sender="org.freedesktop.timedate1"/>
|
||||
</policy>
|
||||
|
||||
<policy context="default">
|
||||
<allow send_destination="org.freedesktop.timedate1"/>
|
||||
<allow receive_sender="org.freedesktop.timedate1"/>
|
||||
</policy>
|
||||
|
||||
</busconfig>
|
41
data/org.freedesktop.timedate1.policy
Normal file
41
data/org.freedesktop.timedate1.policy
Normal file
@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
|
||||
<policyconfig>
|
||||
<vendor>slack-timedate</vendor>
|
||||
|
||||
<action id="org.freedesktop.timedate1.set-time">
|
||||
<message>Changes the system clock</message>
|
||||
<defaults>
|
||||
<allow_any>auth_admin_keep</allow_any>
|
||||
<allow_inactive>auth_admin_keep</allow_inactive>
|
||||
<allow_active>auth_admin_keep</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
|
||||
<action id="org.freedesktop.timedate1.set-timezone">
|
||||
<message>Sets the system timezone</message>
|
||||
<defaults>
|
||||
<allow_any>auth_admin_keep</allow_any>
|
||||
<allow_inactive>auth_admin_keep</allow_inactive>
|
||||
<allow_active>auth_admin_keep</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
|
||||
<action id="org.freedesktop.timedate1.set-local-rtc">
|
||||
<message>Controls whether the RTC is in local time or UTC</message>
|
||||
<defaults>
|
||||
<allow_any>auth_admin_keep</allow_any>
|
||||
<allow_inactive>auth_admin_keep</allow_inactive>
|
||||
<allow_active>auth_admin_keep</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
|
||||
<action id="org.freedesktop.timedate1.set-ntp">
|
||||
<message>Controls whether the system clock is synchronized with the network</message>
|
||||
<defaults>
|
||||
<allow_any>auth_admin_keep</allow_any>
|
||||
<allow_inactive>auth_admin_keep</allow_inactive>
|
||||
<allow_active>auth_admin_keep</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
</policyconfig>
|
4
data/org.freedesktop.timedate1.service.in
Normal file
4
data/org.freedesktop.timedate1.service.in
Normal file
@ -0,0 +1,4 @@
|
||||
[D-BUS Service]
|
||||
Name=org.freedesktop.timedate1
|
||||
Exec=@LIBEXECDIR@/slack-timedate
|
||||
User=root
|
27
data/org.freedesktop.timedate1.xml
Normal file
27
data/org.freedesktop.timedate1.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<!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.timedate1">
|
||||
<property name="Timezone" type="s" access="read"/>
|
||||
<property name="LocalRTC" type="b" access="read"/>
|
||||
<property name="NTP" type="b" access="read"/>
|
||||
<method name="SetTime">
|
||||
<arg name="usec_utc" type="x" direction="in"/>
|
||||
<arg name="relative" type="b" direction="in"/>
|
||||
<arg name="user_interaction" type="b" direction="in"/>
|
||||
</method>
|
||||
<method name="SetTimezone">
|
||||
<arg name="timezone" type="s" direction="in"/>
|
||||
<arg name="user_interaction" type="b" direction="in"/>
|
||||
</method>
|
||||
<method name="SetLocalRTC">
|
||||
<arg name="local_rtc" type="b" direction="in"/>
|
||||
<arg name="fix_system" type="b" direction="in"/>
|
||||
<arg name="user_interaction" type="b" direction="in"/>
|
||||
</method>
|
||||
<method name="SetNTP">
|
||||
<arg name="use_ntp" type="b" direction="in"/>
|
||||
<arg name="user_interaction" type="b" direction="in"/>
|
||||
</method>
|
||||
</interface>
|
||||
</node>
|
Reference in New Issue
Block a user