Skip to content

tailcat, cmd/tailcat: stop drop boxes leaking file existence, add :wo+ - #69

Merged
bradfitz merged 1 commit into
mainfrom
bradfitz/file_wop
Sep 2, 2026
Merged

bradfitz merged 1 commit into
mainfrom
bradfitz/file_wop

Conversation

@bradfitz

@bradfitz bradfitz commented Sep 2, 2026

Copy link
Copy Markdown
Member

Even after d796f88, a write-only drop box revealed whether a
requested filename already existed: exclusive creation failed on a
collision, and directories could be stat'd. Store each upload under a
server-chosen name (with a UTC timestamp and random suffix) so the
same request succeeds either way, and make the flat :wo mode reject
directories entirely.

For directory trees, add a :wo+ mode that keeps requested names when
free and falls back to a server-chosen name on collision. It lets
clients make and stat directories, which necessarily reveals whether
some paths exist, so it's a separate opt-in: the new
"tailcat recv --accept-dirs" flag, whose help text documents the
trade-off.

Thanks to Will Frame for the report!

Reported-by: Will Frame (https://wpf.nz/)

Even after d796f88, a write-only drop box revealed whether a
requested filename already existed: exclusive creation failed on a
collision, and directories could be stat'd. Store each upload under a
server-chosen name (with a UTC timestamp and random suffix) so the
same request succeeds either way, and make the flat :wo mode reject
directories entirely.

For directory trees, add a :wo+ mode that keeps requested names when
free and falls back to a server-chosen name on collision. It lets
clients make and stat directories, which necessarily reveals whether
some paths exist, so it's a separate opt-in: the new
"tailcat recv --accept-dirs" flag, whose help text documents the
trade-off.

Thanks to Will Frame for the report!

Reported-by: Will Frame (https://wpf.nz/)

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
@bradfitz
bradfitz merged commit 521eea9 into main Sep 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant