hostnamed: SetPrettyHostname() should check PK action org.freedesktop.hostname1.set-static-hostname

This commit is contained in:
Lennart Poettering 2011-05-12 16:14:44 +02:00
parent bd118f8e22
commit 88a07670cf
3 changed files with 11 additions and 2 deletions

3
TODO
View File

@ -19,6 +19,9 @@ F15 External:
Features:
* Make it possible to set the keymap independently from the font on
the kernel cmdline. Right now setting one resets also the other.
* make use of TIOCVHANGUP
* move /selinux to /sys/fs/selinux

View File

@ -568,7 +568,13 @@ static DBusHandlerResult hostname_message_handler(
if (!streq_ptr(name, data[k])) {
r = verify_polkit(connection, message, "org.freedesktop.hostname1.set-machine-info", interactive, &error);
/* Since the pretty hostname should always be
* changed at the same time as the static one,
* use the same policy action for both... */
r = verify_polkit(connection, message, k == PROP_PRETTY_HOSTNAME ?
"org.freedesktop.hostname1.set-static-hostname" :
"org.freedesktop.hostname1.set-machine-info", interactive, &error);
if (r < 0)
return bus_send_error_reply(connection, message, &error, r);

View File

@ -28,7 +28,7 @@
<action id="org.freedesktop.hostname1.set-static-hostname">
<description>Set static host name</description>
<message>Authentication is required to set the statically configured local host name.</message>
<message>Authentication is required to set the statically configured local host name, as well as the pretty host name.</message>
<defaults>
<allow_any>auth_admin_keep</allow_any>
<allow_inactive>auth_admin_keep</allow_inactive>