summaryrefslogtreecommitdiffhomepage
path: root/control/controlhttp/controlhttpserver
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@tailscale.com>2026-04-14 02:13:37 +0000
committerBrad Fitzpatrick <brad@danga.com>2026-04-14 07:13:10 -0700
commita0a8fae8566fc41018faff5162d955e25f99ab4d (patch)
treeb6f5ae3e9634a2cee45672a0f98a6b0a4e05305e /control/controlhttp/controlhttpserver
parent621dc9cf1b5afb7d2ba00fc1c525d503175a4052 (diff)
downloadtailscale-a0a8fae8566fc41018faff5162d955e25f99ab4d.tar.xz
tailscale-a0a8fae8566fc41018faff5162d955e25f99ab4d.zip
tstest/integration: use linkat to hardlink test binaries on Linux
Use linkat via /proc/self/fd with AT_SYMLINK_FOLLOW to create a hardlink of the test binary instead of copying it. This avoids copying ~50MB+ binaries into each test's temp directory, making test setup faster and reducing disk I/O. The simpler os.Link(b.Path, ret.Path) can't be used here because the source binary lives in the first test's TempDir, which may be cleaned up before later tests call CopyTo. The open FD keeps the inode alive after the path is deleted, but os.Link needs a valid path. (See also b9f468240f which tried os.Link but is racy for this reason.) The /proc/self/fd approach works without elevated privileges, unlike AT_EMPTY_PATH which requires CAP_DAC_READ_SEARCH. If the linkat fails for any reason (e.g. cross-filesystem temp dirs), it falls back to the existing full-copy path. Fixes #19397 Change-Id: I4b1f97f7e63a9ae9e09dce36dfbdd1f6cff92320 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Diffstat (limited to 'control/controlhttp/controlhttpserver')
0 files changed, 0 insertions, 0 deletions