From: Lennart Poettering Date: Thu, 12 May 2011 14:14:44 +0000 (+0200) Subject: hostnamed: SetPrettyHostname() should check PK action org.freedesktop.hostname1.set... X-Git-Tag: v27~16 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88a07670cfa974a605c7c7b520b8a3135fce37f9;p=systemd hostnamed: SetPrettyHostname() should check PK action org.freedesktop.hostname1.set-static-hostname --- diff --git a/TODO b/TODO index 7bb4f144..c54378dd 100644 --- a/TODO +++ b/TODO @@ -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 diff --git a/src/hostnamed.c b/src/hostnamed.c index 8c0035a0..91a82c82 100644 --- a/src/hostnamed.c +++ b/src/hostnamed.c @@ -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); diff --git a/src/org.freedesktop.hostname1.policy b/src/org.freedesktop.hostname1.policy index 148874fc..0ad64d9e 100644 --- a/src/org.freedesktop.hostname1.policy +++ b/src/org.freedesktop.hostname1.policy @@ -28,7 +28,7 @@ Set static host name - Authentication is required to set the statically configured local host name. + Authentication is required to set the statically configured local host name, as well as the pretty host name. auth_admin_keep auth_admin_keep