diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-04-08 16:14:47 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-04-08 16:14:47 +0900 |
| commit | b0ba16510791428669aea6f54a5f8b263e159dee (patch) | |
| tree | e4a974520cb6ded1c12aa490351f63ef66d90edc /test | |
| parent | 351d6c5a35adcf07ccfe62add266d5db540400ed (diff) | |
cmd/sharefs: group-accessible permission bits
This works around the race in vfs via supplementary group.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'test')
| -rw-r--r-- | test/interactive/configuration.nix | 5 | ||||
| -rw-r--r-- | test/interactive/raceattr.nix | 44 |
2 files changed, 29 insertions, 20 deletions
diff --git a/test/interactive/configuration.nix b/test/interactive/configuration.nix index 9d1bddd8..c7765795 100644 --- a/test/interactive/configuration.nix +++ b/test/interactive/configuration.nix @@ -8,7 +8,10 @@ description = "Alice Foobar"; password = "foobar"; uid = 1000; - extraGroups = [ "wheel" ]; + extraGroups = [ + "wheel" + "sharefs" + ]; }; untrusted = { isNormalUser = true; diff --git a/test/interactive/raceattr.nix b/test/interactive/raceattr.nix index 8140beb1..d94d7a7b 100644 --- a/test/interactive/raceattr.nix +++ b/test/interactive/raceattr.nix @@ -1,24 +1,30 @@ { lib, pkgs, ... }: -let - inherit (pkgs) buildGoModule; -in { - environment.systemPackages = [ - (buildGoModule rec { - name = "raceattr"; - pname = name; - tags = [ "raceattr" ]; + security.wrappers.raceattr = + let + inherit (pkgs) buildGoModule; + in + { + setuid = true; + owner = "root"; + group = "root"; + source = "${ + (buildGoModule rec { + name = "raceattr"; + pname = name; + tags = [ "raceattr" ]; - src = builtins.path { - name = "${pname}-src"; - path = lib.cleanSource ../../cmd/sharefs/test; - filter = path: type: (type == "directory") || (type == "regular" && lib.hasSuffix ".go" path); - }; - vendorHash = null; + src = builtins.path { + name = "${pname}-src"; + path = lib.cleanSource ../../cmd/sharefs/test; + filter = path: type: (type == "directory") || (type == "regular" && lib.hasSuffix ".go" path); + }; + vendorHash = null; - preBuild = '' - go mod init hakurei.app/raceattr >& /dev/null - ''; - }) - ]; + preBuild = '' + go mod init hakurei.app/raceattr >& /dev/null + ''; + }) + }/bin/raceattr"; + }; } |
