Skip to content

Commit 08263df

Browse files
committed
nix: add su to the tailscale image for taildrive's fileserver
taildrive (TestGrantCapDrive) spawns its per-user fileserver by re-execing tailscaled under su; running as root with no su on PATH, canSU() fails and the fallback hits assertNotRoot(), so the fileserver never starts and shares fail with "unable to determine address for share". The released alpine images ship busybox su; expose that applet on the nix-built head image too.
1 parent dbcfc16 commit 08263df

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

nix/images.nix

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ let
5151
done
5252
'';
5353

54+
# taildrive (TestGrantCapDrive) spawns its per-user fileserver by re-execing
55+
# tailscaled under `su` (tailscale drive/driveimpl/remote_impl.go): tailscaled
56+
# runs as root and sus to the share's user. With no `su` on PATH canSU() fails,
57+
# the fallback hits assertNotRoot() while root, the fileserver never starts,
58+
# and every share fails with "unable to determine address for share". The
59+
# released alpine images ship busybox su; expose just that applet here so it
60+
# does not shadow coreutils on the image PATH.
61+
busyboxSu = pkgs.runCommand "busybox-su" { } ''
62+
mkdir -p $out/bin
63+
ln -s ${pkgs.busybox}/bin/busybox $out/bin/su
64+
'';
65+
5466
# Tailscale HEAD client + daemon + derper, built once from the pinned source.
5567
# Mirrors Dockerfile.tailscale-HEAD / Dockerfile.derper's `go install`.
5668
tailscaleHead = buildGoModule {
@@ -131,6 +143,7 @@ let
131143
pkgs.getent # tailscale SSH server execs `getent passwd <user>`
132144
pkgs.hostname # SSH tests run `hostname` on the peer over the session
133145
pkgs.traceroute # HA/route tests assert path via traceroute (head-only)
146+
busyboxSu # taildrive sus to spawn its per-user fileserver (TestGrantCapDrive)
134147
] ++ baseUserland;
135148
# buildLayeredImage puts every package's bin on /bin, which is on PATH, so
136149
# the suite resolves tailscale/tailscaled/derper/curl/ssh/... directly — no

0 commit comments

Comments
 (0)