change polkit action names to match systemd's exactly
authorkremlin <ian@kremlin.cc>
Mon, 18 Aug 2014 06:32:14 +0000 (01:32 -0500)
committerkremlin <ian@kremlin.cc>
Mon, 18 Aug 2014 06:32:14 +0000 (01:32 -0500)
gnome-control-center has polkit rules which refer explicitly to action
names we need to match for it to work with our code properly

conf/polkit-policy/org.freedesktop.hostname1.policy
conf/polkit-policy/org.freedesktop.locale1.policy
conf/polkit-policy/org.freedesktop.timedate1.policy
src/interfaces/hostnamed/hostnamed.c

index c36f736350e826cff8b4cd45a0c53cec3c8c2dce..2ea55b4fb99322df7a88ad4886dd4db52cb89922 100644 (file)
@@ -5,7 +5,7 @@
     <vendor>OpenBSD</vendor>
     <vendor_url>https://uglyman.kremlin.cc/gitweb/gitweb.cgi?p=systemd-utl.git</vendor_url> <!-- TODO change or redirect this URL when we rebase -->
 
     <vendor>OpenBSD</vendor>
     <vendor_url>https://uglyman.kremlin.cc/gitweb/gitweb.cgi?p=systemd-utl.git</vendor_url> <!-- TODO change or redirect this URL when we rebase -->
 
-    <action id="org.freedesktop.hostname1.SetHostname">
+    <action id="org.freedesktop.hostname1.set-hostname">
         <description>Set dynamic (system) hostname.</description>
         <message>Setting the dynamic (system) hostname requires authentication.</message>
         <defaults>
         <description>Set dynamic (system) hostname.</description>
         <message>Setting the dynamic (system) hostname requires authentication.</message>
         <defaults>
@@ -15,7 +15,7 @@
         </defaults>
     </action>
 
         </defaults>
     </action>
 
-    <action id="org.freedesktop.hostname1.SetStaticHostname">
+    <action id="org.freedesktop.hostname1.set-static-hostname">
         <description>Set static hostname.</description>
         <message>Setting the static hostname requires authentication.</message>
         <defaults>
         <description>Set static hostname.</description>
         <message>Setting the static hostname requires authentication.</message>
         <defaults>
@@ -25,7 +25,7 @@
         </defaults>
     </action>
 
         </defaults>
     </action>
 
-    <action id="org.freedesktop.hostname1.SetPrettyHostname">
+    <action id="org.freedesktop.hostname1.set-pretty-hostname">
         <description>Set pretty (UTF-8) hostname.</description>
         <message>Setting the pretty (UTF-8) hostname requires authentication.</message>
         <defaults>
         <description>Set pretty (UTF-8) hostname.</description>
         <message>Setting the pretty (UTF-8) hostname requires authentication.</message>
         <defaults>
@@ -35,7 +35,7 @@
         </defaults>
     </action>
 
         </defaults>
     </action>
 
-    <action id="org.freedesktop.hostname1.SetIconName">
+    <action id="org.freedesktop.hostname1.set-icon-name">
         <description>Set system's icon name.</description>
         <message>Setting the system's icon name requires authentication.</message>
         <defaults>
         <description>Set system's icon name.</description>
         <message>Setting the system's icon name requires authentication.</message>
         <defaults>
@@ -45,7 +45,7 @@
         </defaults>
     </action>
 
         </defaults>
     </action>
 
-    <action id="org.freedesktop.hostname1.SetChassis">
+    <action id="org.freedesktop.hostname1.set-chassis">
         <description>Set system's chassis type.</description>
         <message>Setting the system's chassis type requires authentication.</message>
         <defaults>
         <description>Set system's chassis type.</description>
         <message>Setting the system's chassis type requires authentication.</message>
         <defaults>
index d60526725786505367ee2a4723d36fdf7e5d52f1..4430e9c498c8cdb3e0def16c70774e7d207b3a31 100644 (file)
@@ -5,7 +5,7 @@
     <vendor>OpenBSD</vendor>
     <vendor_url>https://uglyman.kremlin.cc/gitweb/gitweb.cgi?p=systemd-utl.git</vendor_url> <!-- TODO change or redirect this URL when we rebase -->
 
     <vendor>OpenBSD</vendor>
     <vendor_url>https://uglyman.kremlin.cc/gitweb/gitweb.cgi?p=systemd-utl.git</vendor_url> <!-- TODO change or redirect this URL when we rebase -->
 
-    <action id="org.freedesktop.locale1.SetLocale">
+    <action id="org.freedesktop.locale1.set-locale">
         <description>Set system's locale.</description>
         <message>Setting the system's locale requires authentication.</message>
         <defaults>
         <description>Set system's locale.</description>
         <message>Setting the system's locale requires authentication.</message>
         <defaults>
@@ -15,7 +15,7 @@
         </defaults>
     </action>
 
         </defaults>
     </action>
 
-    <action id="org.freedesktop.locale1.SetX11Keyboard">
+    <action id="org.freedesktop.locale1.set-keyboard">
         <description>Set Xorg keymap.</description>
         <message>Setting Xorg's keymap requires authentication.</message>
         <defaults>
         <description>Set Xorg keymap.</description>
         <message>Setting Xorg's keymap requires authentication.</message>
         <defaults>
index 3bd95b42c3a7f67588bb827a95ae3aaf05a0bd00..f15371a8980f738cc6e74dd3ef6411f5bfe6f96f 100644 (file)
@@ -5,7 +5,7 @@
     <vendor>OpenBSD</vendor>
     <vendor_url>https://uglyman.kremlin.cc/gitweb/gitweb.cgi?p=systemd-utl.git</vendor_url> <!-- TODO change or redirect this URL when we rebase -->
 
     <vendor>OpenBSD</vendor>
     <vendor_url>https://uglyman.kremlin.cc/gitweb/gitweb.cgi?p=systemd-utl.git</vendor_url> <!-- TODO change or redirect this URL when we rebase -->
 
-    <action id="org.freedesktop.timedate1.SetTime">
+    <action id="org.freedesktop.timedate1.set-time">
         <description>Set system time.</description>
         <message>Setting the system time requires authentication.</message>
         <defaults>
         <description>Set system time.</description>
         <message>Setting the system time requires authentication.</message>
         <defaults>
@@ -15,7 +15,7 @@
         </defaults>
     </action>
 
         </defaults>
     </action>
 
-    <action id="org.freedesktop.timedate1.SetTimezone">
+    <action id="org.freedesktop.timedate1.set-timezone">
         <description>Set local timezone.</description>
         <message>Setting the timezone requires authentication.</message>
         <defaults>
         <description>Set local timezone.</description>
         <message>Setting the timezone requires authentication.</message>
         <defaults>
@@ -25,7 +25,7 @@
         </defaults>
     </action>
 
         </defaults>
     </action>
 
-    <action id="org.freedesktop.timedate1.SetLocalRTC">
+    <action id="org.freedesktop.timedate1.set-local-rtc">
         <description>Switch RTC between UTC and local time.</description>
         <message>Switching to the system's real time clock source requires authentication.</message>
         <defaults>
         <description>Switch RTC between UTC and local time.</description>
         <message>Switching to the system's real time clock source requires authentication.</message>
         <defaults>
@@ -35,7 +35,7 @@
         </defaults>
     </action>
 
         </defaults>
     </action>
 
-    <action id="org.freedesktop.timedate1.SetNTP">
+    <action id="org.freedesktop.timedate1.set-ntp">
         <description>Toggle clock synchronization through NTP.</description>
         <message>Toggling NTP requires authentication.</message>
         <defaults>
         <description>Toggle clock synchronization through NTP.</description>
         <message>Toggling NTP requires authentication.</message>
         <defaults>
index 3dae12ce0062c31ce77f37e87a89d6181a1f46e5..3f63e0a027416128ac3f12fb495ff1dc573a27b3 100644 (file)
@@ -133,7 +133,7 @@ on_handle_set_hostname(Hostname1 *hn1_passed_interf,
     bus_name = g_dbus_method_invocation_get_sender(invoc);
 
     /* verify caller has correct permissions via polkit */
     bus_name = g_dbus_method_invocation_get_sender(invoc);
 
     /* verify caller has correct permissions via polkit */
-    is_authed = polkit_try_auth(bus_name, "org.freedesktop.hostname1.SetHostname", policykit_auth);
+    is_authed = polkit_try_auth(bus_name, "org.freedesktop.hostname1.set-hostname", policykit_auth);
 
     switch(is_authed) {
 
 
     switch(is_authed) {
 
@@ -210,7 +210,7 @@ on_handle_set_static_hostname(Hostname1 *hn1_passed_interf,
     bus_name = g_dbus_method_invocation_get_sender(invoc);
 
     /* verify caller has correct permissions via polkit */
     bus_name = g_dbus_method_invocation_get_sender(invoc);
 
     /* verify caller has correct permissions via polkit */
-    is_authed = polkit_try_auth(bus_name, "org.freedesktop.hostname1.SetStaticHostname", policykit_auth);
+    is_authed = polkit_try_auth(bus_name, "org.freedesktop.hostname1.set-static-hostname", policykit_auth);
 
     switch(is_authed) {
 
 
     switch(is_authed) {
 
@@ -289,7 +289,7 @@ on_handle_set_pretty_hostname(Hostname1 *hn1_passed_interf,
     bus_name = g_dbus_method_invocation_get_sender(invoc);
 
     /* verify caller has correct permissions via polkit */
     bus_name = g_dbus_method_invocation_get_sender(invoc);
 
     /* verify caller has correct permissions via polkit */
-    is_authed = polkit_try_auth(bus_name, "org.freedesktop.hostname1.SetPrettyHostname", policykit_auth);
+    is_authed = polkit_try_auth(bus_name, "org.freedesktop.hostname1.set-pretty-hostname", policykit_auth);
 
     switch(is_authed) {
 
 
     switch(is_authed) {
 
@@ -389,7 +389,7 @@ on_handle_set_chassis(Hostname1 *hn1_passed_interf,
     g_strlcpy(valid_chassis_name_buf, proposed_chassis_name, (gsize)64);
 
     /* verify caller has correct permissions via polkit */
     g_strlcpy(valid_chassis_name_buf, proposed_chassis_name, (gsize)64);
 
     /* verify caller has correct permissions via polkit */
-    is_authed = polkit_try_auth(bus_name, "org.freedesktop.hostname1.SetChassis", policykit_auth);
+    is_authed = polkit_try_auth(bus_name, "org.freedesktop.hostname1.set-chassis", policykit_auth);
 
     switch(is_authed) {
 
 
     switch(is_authed) {
 
@@ -473,7 +473,7 @@ on_handle_set_icon_name(Hostname1 *hn1_passed_interf,
     bus_name = g_dbus_method_invocation_get_sender(invoc);
 
     /* verify caller has correct permissions via polkit */
     bus_name = g_dbus_method_invocation_get_sender(invoc);
 
     /* verify caller has correct permissions via polkit */
-    is_authed = polkit_try_auth(bus_name, "org.freedesktop.hostname1.SetIconName", policykit_auth);
+    is_authed = polkit_try_auth(bus_name, "org.freedesktop.hostname1.set-icon-name", policykit_auth);
 
     switch(is_authed) {
 
 
     switch(is_authed) {