GNOME Bugzilla – Bug 679281
No way to change pretty hostname
Last modified: 2012-08-22 13:24:49 UTC
The pretty hostname is not editable even for admin accounts. Also, we don't seem to be monitoring the service for name changes.
The hostname is not editable because the default policy has <action id="org.freedesktop.hostname1.set-hostname"> <description>Set host name</description> <description xml:lang="pl">Ustawienie nazwy komputera</description> <message>Authentication is required to set the local host name.</message> <message xml:lang="pl">Wymagane jest uwierzytelnienie, aby ustawić nazwę lokalnego komputera.</message> <defaults> <allow_any>auth_admin_keep</allow_any> <allow_inactive>auth_admin_keep</allow_inactive> <allow_active>auth_admin_keep</allow_active> </defaults> </action> And gnome-control-center doesn't make the field editable unless the polkit response is 'yes'. Possible solutions: - add a way to bring up the polkit auth dialog when the reply from polkit is 'maybe' - override the default policy by installing a rules file that sets allow_active to 'yes'
Can we make it a "yes" for admins in active sessions?
It is possible to write a rule that does that, pretty sure. http://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html#polkit-rules has instructive examples
That would make a reasonable default I think.
<hadess> fredp, another one for 3.6 blockers: https://bugzilla.gnome.org/show_bug.cgi?id=679281
Here's a rule that works: polkit.addRule(function(action, subject) { if (action.id == "org.freedesktop.hostname1.set-static-hostname" && subject.local && subject.active && subject.isInGroup ("wheel")) { return polkit.Result.YES; } }); Put this in a file called gnome-control-center.rules, and install it in /usr/share/polkit-1/rules.d/
commit 4d62e05fb088d64c3133912f0995a42157b8e968 Author: Matthias Clasen <mclasen@redhat.com> Date: Wed Aug 22 14:15:04 2012 +0100 common: Add Policykit rules for hostname setting Allow setting the computer's pretty hostname if the user is an admin. https://bugzilla.gnome.org/show_bug.cgi?id=679281
*** Bug 676979 has been marked as a duplicate of this bug. ***