chiark / gitweb /
hostnamed: SetPrettyHostname() should check PK action org.freedesktop.hostname1.set...
authorLennart Poettering <lennart@poettering.net>
Thu, 12 May 2011 14:14:44 +0000 (16:14 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 12 May 2011 14:14:44 +0000 (16:14 +0200)
TODO
src/hostnamed.c
src/org.freedesktop.hostname1.policy

diff --git a/TODO b/TODO
index 7bb4f144f319228a1c9f5599312baf46208484bf..c54378dda5cdb634cb01be6e5f9f9277da06040e 100644 (file)
--- 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
index 8c0035a03774c17ee837ce7cb22bf3747cebbda6..91a82c8255fa2962b369b9eadb2982fe628a1c7a 100644 (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);
 
index 148874fc890a8424cb93254581ebdbc34a0eeb21..0ad64d9ee142609ee9a5a19515a51802373c2ba4 100644 (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>