From d8dff294a5313398c1e53d590bb43f902fc9a952 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Sat, 16 Dec 2023 13:46:54 -0500 Subject: [PATCH] Accept '*' as well --- crates/nix_health/src/check/trusted_users.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/nix_health/src/check/trusted_users.rs b/crates/nix_health/src/check/trusted_users.rs index 989ca022..9d2c39fd 100644 --- a/crates/nix_health/src/check/trusted_users.rs +++ b/crates/nix_health/src/check/trusted_users.rs @@ -53,7 +53,11 @@ fn is_current_user_trusted(nix_info: &nix_rs::info::NixInfo) -> bool { let current_user_groups: HashSet<&String> = nix_info.nix_env.current_user_groups.iter().collect(); let val = &nix_info.nix_config.trusted_users.value; - // In nix.conf, groups are prefixed with '@'. + // In nix.conf, groups are prefixed with '@'. '*' means all users are + // trusted. + if val.contains(&"*".to_string()) { + return true; + } let (val_groups, val_users): (Vec, Vec) = val.iter().partition_map(|x| match x.strip_prefix('@') { Some(x) => Either::Left(x.to_string()),