summaryrefslogtreecommitdiff
path: root/src/hostnamed.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-05-12 16:14:44 +0200
committerLennart Poettering <lennart@poettering.net>2011-05-12 16:14:44 +0200
commit88a07670cfa974a605c7c7b520b8a3135fce37f9 (patch)
tree8a375e1425abc9cd4a12e9f2af13a0be1a61790f /src/hostnamed.c
parentbd118f8e2262d5703120442aa48bd942d2116b75 (diff)
hostnamed: SetPrettyHostname() should check PK action org.freedesktop.hostname1.set-static-hostname
Diffstat (limited to 'src/hostnamed.c')
-rw-r--r--src/hostnamed.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/hostnamed.c b/src/hostnamed.c
index 8c0035a037..91a82c8255 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);