From efc1c027ad6f2c0b31416c876dcf282539d45ea7 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Mon, 9 Dec 2019 01:38:33 -0500 Subject: [PATCH] nixos/polkit: remove root from adminIdentities Fixes https://github.com/NixOS/nixpkgs/issues/75075. To summarize the report in the aforementioned issue, at a glance, it's a different default than what upstream polkit has. Apparently for 8+ years polkit defaults admin identities as members of the wheel group [0]. This assumption would be appropriate on NixOS, where every member of group 'wheel' is necessarily privileged. [0]: https://gitlab.freedesktop.org/polkit/polkit/commit/763faf434b445c20ae9529100d3ef5290976d0c9 --- nixos/doc/manual/release-notes/rl-2003.xml | 10 ++++++++++ nixos/modules/security/polkit.nix | 5 ++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2003.xml b/nixos/doc/manual/release-notes/rl-2003.xml index 886b16ef965..579b8d53744 100644 --- a/nixos/doc/manual/release-notes/rl-2003.xml +++ b/nixos/doc/manual/release-notes/rl-2003.xml @@ -225,6 +225,16 @@ The fourStore and fourStoreEndpoint modules have been removed. + + + Polkit no longer has the user of uid 0 (root) as an admin identity. + We now follow the upstream default of only having every member of the wheel + group admin privileged. Before it was root and members of wheel. + The positive outcome of this is pkexec GUI popups or terminal prompts + will no longer require the user to choose between two essentially equivalent + choices (whether to perform the action as themselves with wheel permissions, or as the root user). + + diff --git a/nixos/modules/security/polkit.nix b/nixos/modules/security/polkit.nix index f2b2df4004c..a6724bd7583 100644 --- a/nixos/modules/security/polkit.nix +++ b/nixos/modules/security/polkit.nix @@ -42,15 +42,14 @@ in security.polkit.adminIdentities = mkOption { type = types.listOf types.str; - default = [ "unix-user:0" "unix-group:wheel" ]; + default = [ "unix-group:wheel" ]; example = [ "unix-user:alice" "unix-group:admin" ]; description = '' Specifies which users are considered “administrators”, for those actions that require the user to authenticate as an administrator (i.e. have an auth_admin - value). By default, this is the root - user and all users in the wheel group. + value). By default, this is all users in the wheel group. ''; };