Skip to content

herdr: a socket path containing ':' cannot round-trip through the pane locator #1166

Description

@fujibee

The pane locator is a colon-joined triple, <kind>:<instance>:<pane>. For
herdr the instance is the socket path. A socket path may legally contain a
colon, and the joined form cannot be taken apart again when it does.

Today this fails closed rather than silently: terminal_fence in the herdr
driver rejects a colon-bearing socket path and names the reason
(socket_path_malformed), so no ambiguous locator is ever produced. That is
the right behaviour for now and this issue is not asking to change it.

What this issue records is the cost: a user whose herdr socket sits under a
path with a colon in it cannot be addressed by the sweep at all. The reason
is reported, so the failure is visible rather than silent, but the seat is
unreachable.

Fixing it means an encoding for the instance component. The reason that is
not being done in the current release branch is that an encoding is a new
grammar, and every reader of a locator has to implement it identically for
it to mean anything — several readers are in flight at once. Adding a
grammar across all of them at the same time is the shape of change that
leaves one reader behind, and a reader that decodes differently produces a
locator that points somewhere real and wrong.

Scope when this is picked up:

  • one encoder and one decoder, in the shared registry, used by every reader
    (no per-caller parsing)
  • a round-trip property test over paths containing :, whitespace-adjacent
    characters, and the existing rejected set
  • the rejection path stays, for anything the encoding still cannot carry,
    and keeps naming its reason
  • the negative case: a locator encoded by one version and decoded by an
    older one must fail closed, not resolve to a different pane

Related: the tmux side of the same locator question, and the pane-locator
triple generally.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions