Skip to content

Commit

Permalink
Accept '*' as well
Browse files Browse the repository at this point in the history
  • Loading branch information
srid committed Dec 16, 2023
1 parent eb8e85d commit d8dff29
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/nix_health/src/check/trusted_users.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>, Vec<String>) =
val.iter().partition_map(|x| match x.strip_prefix('@') {
Some(x) => Either::Left(x.to_string()),
Expand Down

0 comments on commit d8dff29

Please sign in to comment.