You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
why: A tmux socket is a UNIX domain socket, so its path is capped by
sockaddr_un -- 107 bytes on Linux, 103 on macOS. Server accepted any
path and the overrun arrived at the first tmux command as a passed-
through "File name too long", blamed on new-session rather than on the
socket, and without the one number the caller needed: how far over.
The length is usually inherited rather than typed -- a deep pytest
tmp_path, an XDG runtime dir, a nested worktree, a long $TMUX_TMPDIR --
so the path that failed is one nobody wrote. Closes#725.
what:
- Add libtmux.exc.SocketPathTooLong, carrying the byte count, the
limit, the path, and the socket name when the path was resolved
rather than passed in
- Add _internal.env.SOCKET_PATH_MAX_BYTES (sun_path size per platform,
less the NUL) and check_socket_path_length(), which measures with
os.fsencode as the kernel does
- Measure in Server.__init__: a given socket_path, and the path a
socket_name, a socket_name_factory, or a bare Server() resolves to
under $TMUX_TMPDIR
- Document the limit and the shorter-socket-dir workaround on Server,
in the pytest plugin usage guide, and on the env var page
- Test both routes, the boundary, and probe the running kernel to keep
the per-platform size honest
0 commit comments