From e038bcf4d25d6da5da2ec5efaadacd52d633bb7f Mon Sep 17 00:00:00 2001 From: "Adam C. Stephens" Date: Tue, 16 Dec 2025 18:29:40 -0500 Subject: [PATCH 1/2] sudo-rs: 0.2.10 -> 0.2.11 Changelog: https://github.com/trifectatechfoundation/sudo-rs/blob/v0.2.11/CHANGELOG.md --- pkgs/by-name/su/sudo-rs/package.nix | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/su/sudo-rs/package.nix b/pkgs/by-name/su/sudo-rs/package.nix index 83edf63ce93a..af4da9c1f9c0 100644 --- a/pkgs/by-name/su/sudo-rs/package.nix +++ b/pkgs/by-name/su/sudo-rs/package.nix @@ -7,29 +7,28 @@ versionCheckHook, pam, rustPlatform, - tzdata, }: rustPlatform.buildRustPackage (finalAttrs: { pname = "sudo-rs"; - version = "0.2.10"; + version = "0.2.11"; src = fetchFromGitHub { owner = "trifectatechfoundation"; repo = "sudo-rs"; tag = "v${finalAttrs.version}"; - hash = "sha256-DGoEHeVs7EbzpfbmJQEIsL/eWXBvUCbaSPAGD65Op7k="; + hash = "sha256-F1JwVP2GDzKCfiJXh8PXTBghNwWeD8a+TMiEaPx6wGg="; }; - cargoHash = "sha256-fn97cKdaIsbozI794CAeWQooC7evTErRJOg6cEjzvjY="; + cargoHash = "sha256-6NhyPdOAk2va8Vibsfpfq3xGLIzDBRmqxj4bZhQT9bY="; nativeBuildInputs = [ installShellFiles ]; buildInputs = [ pam ]; postPatch = '' - substituteInPlace build.rs \ - --replace-fail "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo" + substituteInPlace src/system/audit.rs \ + --replace-fail "/usr/share/zoneinfo" "/etc/zoneinfo" ''; postInstall = '' @@ -62,6 +61,9 @@ rustPlatform.buildRustPackage (finalAttrs: { "system::interface::test::test_unix_user" "system::tests::test_get_user_and_group_by_id" + # Assumes runtime zoneinfo paths + "sudo::env::environment::tests::test_tzinfo" + # Unsure why those are failing "env::tests::test_environment_variable_filtering" "su::context::tests::invalid_shell" @@ -80,11 +82,7 @@ rustPlatform.buildRustPackage (finalAttrs: { ''; passthru = { - updateScript = nix-update-script { - extraArgs = [ - "--version-regex=^v([0-9]+\\.[0-9]+\\.[0-9])$" - ]; - }; + updateScript = nix-update-script { }; tests = nixosTests.sudo-rs; }; From 7ceda7d52283e2d5bcb2bcb26c0dc2a947dde179 Mon Sep 17 00:00:00 2001 From: r-vdp Date: Wed, 17 Dec 2025 12:26:49 +0200 Subject: [PATCH 2/2] sudo-rs: add a store path for zoneinfo so that sudo-rs also works on non-NixOS --- pkgs/by-name/su/sudo-rs/package.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/su/sudo-rs/package.nix b/pkgs/by-name/su/sudo-rs/package.nix index af4da9c1f9c0..f112b9b1309a 100644 --- a/pkgs/by-name/su/sudo-rs/package.nix +++ b/pkgs/by-name/su/sudo-rs/package.nix @@ -7,6 +7,7 @@ versionCheckHook, pam, rustPlatform, + tzdata, }: rustPlatform.buildRustPackage (finalAttrs: { @@ -28,7 +29,8 @@ rustPlatform.buildRustPackage (finalAttrs: { postPatch = '' substituteInPlace src/system/audit.rs \ - --replace-fail "/usr/share/zoneinfo" "/etc/zoneinfo" + --replace-fail '/usr/share/zoneinfo' '/etc/zoneinfo' \ + --replace-fail '/usr/share/lib/zoneinfo' '${tzdata}/share/zoneinfo' ''; postInstall = '' @@ -61,7 +63,9 @@ rustPlatform.buildRustPackage (finalAttrs: { "system::interface::test::test_unix_user" "system::tests::test_get_user_and_group_by_id" - # Assumes runtime zoneinfo paths + # Store paths are not owned by root in the build sandbox, so the zoneinfo path + # doesn't pass the validations done by sudo-rs. + # This is not an issue at runtime, since there the zoneinfo path is owned by root. "sudo::env::environment::tests::test_tzinfo" # Unsure why those are failing