From 208bfd3e58810614b892c2c59e49c0bb7ed826b3 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Mon, 9 Dec 2024 11:03:03 -0800 Subject: [PATCH] CreateOrMergeNixConfig: don't error when mode is different When we write out the new or merged config, we'll set it to our expected mode anyways, so there's no need to error if it's different. --- src/action/base/create_or_merge_nix_config.rs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/action/base/create_or_merge_nix_config.rs b/src/action/base/create_or_merge_nix_config.rs index 7ebbea639..db3eb8dae 100644 --- a/src/action/base/create_or_merge_nix_config.rs +++ b/src/action/base/create_or_merge_nix_config.rs @@ -147,19 +147,6 @@ impl CreateOrMergeNixConfig { return Err(Self::error(ActionErrorKind::PathWasNotFile(path))); } - // Does the file have the right permissions? - let discovered_mode = metadata.permissions().mode(); - // We only care about user-group-other permissions - let discovered_mode = discovered_mode & 0o777; - - if discovered_mode != NIX_CONF_MODE { - return Err(Self::error(ActionErrorKind::PathModeMismatch( - path, - discovered_mode, - NIX_CONF_MODE, - ))); - } - let existing_nix_config = NixConfig::parse_file(&path) .map_err(CreateOrMergeNixConfigError::ParseNixConfig) .map_err(Self::error)?;