From: kremlin Date: Mon, 18 Aug 2014 06:32:14 +0000 (-0500) Subject: change polkit action names to match systemd's exactly X-Git-Tag: gsoc-final~2 X-Git-Url: https://uglyman.kremlin.cc/gitweb/gitweb.cgi?p=systembsd.git;a=commitdiff_plain;h=5fd84921e6fd01982c6af915aa2129711de5e20b;ds=sidebyside change polkit action names to match systemd's exactly gnome-control-center has polkit rules which refer explicitly to action names we need to match for it to work with our code properly --- diff --git a/conf/polkit-policy/org.freedesktop.hostname1.policy b/conf/polkit-policy/org.freedesktop.hostname1.policy index c36f736..2ea55b4 100644 --- a/conf/polkit-policy/org.freedesktop.hostname1.policy +++ b/conf/polkit-policy/org.freedesktop.hostname1.policy @@ -5,7 +5,7 @@ OpenBSD https://uglyman.kremlin.cc/gitweb/gitweb.cgi?p=systemd-utl.git - + Set dynamic (system) hostname. Setting the dynamic (system) hostname requires authentication. @@ -15,7 +15,7 @@ - + Set static hostname. Setting the static hostname requires authentication. @@ -25,7 +25,7 @@ - + Set pretty (UTF-8) hostname. Setting the pretty (UTF-8) hostname requires authentication. @@ -35,7 +35,7 @@ - + Set system's icon name. Setting the system's icon name requires authentication. @@ -45,7 +45,7 @@ - + Set system's chassis type. Setting the system's chassis type requires authentication. diff --git a/conf/polkit-policy/org.freedesktop.locale1.policy b/conf/polkit-policy/org.freedesktop.locale1.policy index d605267..4430e9c 100644 --- a/conf/polkit-policy/org.freedesktop.locale1.policy +++ b/conf/polkit-policy/org.freedesktop.locale1.policy @@ -5,7 +5,7 @@ OpenBSD https://uglyman.kremlin.cc/gitweb/gitweb.cgi?p=systemd-utl.git - + Set system's locale. Setting the system's locale requires authentication. @@ -15,7 +15,7 @@ - + Set Xorg keymap. Setting Xorg's keymap requires authentication. diff --git a/conf/polkit-policy/org.freedesktop.timedate1.policy b/conf/polkit-policy/org.freedesktop.timedate1.policy index 3bd95b4..f15371a 100644 --- a/conf/polkit-policy/org.freedesktop.timedate1.policy +++ b/conf/polkit-policy/org.freedesktop.timedate1.policy @@ -5,7 +5,7 @@ OpenBSD https://uglyman.kremlin.cc/gitweb/gitweb.cgi?p=systemd-utl.git - + Set system time. Setting the system time requires authentication. @@ -15,7 +15,7 @@ - + Set local timezone. Setting the timezone requires authentication. @@ -25,7 +25,7 @@ - + Switch RTC between UTC and local time. Switching to the system's real time clock source requires authentication. @@ -35,7 +35,7 @@ - + Toggle clock synchronization through NTP. Toggling NTP requires authentication. diff --git a/src/interfaces/hostnamed/hostnamed.c b/src/interfaces/hostnamed/hostnamed.c index 3dae12c..3f63e0a 100644 --- a/src/interfaces/hostnamed/hostnamed.c +++ b/src/interfaces/hostnamed/hostnamed.c @@ -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 */ - 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) { @@ -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 */ - 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) { @@ -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 */ - 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) { @@ -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 */ - 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) { @@ -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 */ - 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) {