style: no em-dash in test comments
This commit is contained in:
parent
120fed8cb4
commit
521777215d
6 changed files with 21 additions and 21 deletions
|
|
@ -113,7 +113,7 @@ party_rec() { printf '%s/party-%s:%s.d/roster\n' "$PARTY_SOCKET_DIR" "$USER" "$1
|
|||
}
|
||||
|
||||
@test "host --group <name> records the chosen group in the roster" {
|
||||
# The stub doesn't care which group we pick — exercise the path that
|
||||
# The stub doesn't care which group we pick: exercise the path that
|
||||
# plumbs --group through to the GROUP= field. Use the caller's primary
|
||||
# group so chgrp succeeds.
|
||||
primary=$(id -gn)
|
||||
|
|
@ -130,7 +130,7 @@ party_rec() { printf '%s/party-%s:%s.d/roster\n' "$PARTY_SOCKET_DIR" "$USER" "$1
|
|||
@test "host with --group works without any pre-existing shared install dir" {
|
||||
# Regression: the old layout required /tmp/roster to be installed at
|
||||
# mode 1770 g=$TMUX_PARTY_GROUP at install time. The new layout has
|
||||
# nothing of the sort — every party is self-contained under PARTY_SOCKET_DIR.
|
||||
# nothing of the sort: every party is self-contained under PARTY_SOCKET_DIR.
|
||||
# Confirm `party host --group` succeeds with a clean sandbox that
|
||||
# never had a shared roster directory.
|
||||
primary=$(id -gn)
|
||||
|
|
@ -165,7 +165,7 @@ party_rec() { printf '%s/party-%s:%s.d/roster\n' "$PARTY_SOCKET_DIR" "$USER" "$1
|
|||
@test "host party_dir ends at mode 0750 even with permissive umask" {
|
||||
# Regression for the umask race: with umask 0002, plain `mkdir` would
|
||||
# produce 0775 until the later chmod 0750 closed the window. mkdir -m
|
||||
# 0700 in cmd_host removes the window entirely — and the postcondition
|
||||
# 0700 in cmd_host removes the window entirely, and the postcondition
|
||||
# is still 0750.
|
||||
( umask 0002 && "$PARTY_BIN" host umasked )
|
||||
party_dir="$PARTY_SOCKET_DIR/party-$USER:umasked.d"
|
||||
|
|
@ -282,7 +282,7 @@ EOF
|
|||
# tmux must not have been touched: the recorder log has nothing for
|
||||
# this party.
|
||||
! grep -q "kill-server" "$TMUX_LOG"
|
||||
# Symlink and victim contents both intact — we did not chase the
|
||||
# Symlink and victim contents both intact: we did not chase the
|
||||
# symlink to delete the attacker's tree.
|
||||
[ -L "$party_dir" ]
|
||||
[ -d "$victim" ]
|
||||
|
|
@ -290,7 +290,7 @@ EOF
|
|||
}
|
||||
|
||||
@test "host warns when PARTY_SOCKET_DIR is not group/world readable" {
|
||||
# The sandbox parent is mode 0700 — trustworthy but undiscoverable to
|
||||
# The sandbox parent is mode 0700, trustworthy but undiscoverable to
|
||||
# invitees. cmd_host should accept it (validator is happy) but emit
|
||||
# a warning so the host notices before sending invites.
|
||||
run "$PARTY_BIN" host noreach
|
||||
|
|
@ -556,7 +556,7 @@ STUB
|
|||
# Trap fired: kill-server invoked against the derived socket.
|
||||
grep -q "$party_dir/sock kill-server" "$TMUX_LOG"
|
||||
|
||||
# Per-party dir is gone — no leftover roster, no leftover sock.
|
||||
# Per-party dir is gone: no leftover roster, no leftover sock.
|
||||
[ ! -e "$party_dir" ]
|
||||
}
|
||||
|
||||
|
|
@ -577,7 +577,7 @@ STUB
|
|||
|
||||
@test "host refuses leftover per-party dir without a roster" {
|
||||
# Simulate a prior incarnation that left a per-party dir behind with
|
||||
# no roster (the rollback trap couldn't fire — SIGKILL or panic).
|
||||
# no roster (the rollback trap couldn't fire: SIGKILL or panic).
|
||||
# cmd_host's mkdir-as-lock acquisition will fail with EEXIST. We
|
||||
# deliberately do NOT auto-clean: the same code path triggers on a
|
||||
# concurrent in-flight host attempt for the same name, and racing
|
||||
|
|
@ -592,7 +592,7 @@ STUB
|
|||
[[ "$output" == *"already exists"* ]]
|
||||
[[ "$output" == *"party clean"* ]]
|
||||
|
||||
# The leftover dir is untouched — proves we did not race-clean.
|
||||
# The leftover dir is untouched: proves we did not race-clean.
|
||||
[ -d "$party_dir" ]
|
||||
[ -e "$party_dir/sock" ]
|
||||
|
||||
|
|
@ -626,7 +626,7 @@ EOF
|
|||
}
|
||||
|
||||
@test "roster_read rejects basename whose party name fails validate_party_name" {
|
||||
# The basename glob (party-*:*.d) is permissive — names like '.' (basename
|
||||
# The basename glob (party-*:*.d) is permissive: names like '.' (basename
|
||||
# party-USER:..d) match it. cmd_host's validate_party_name rejects '.' as
|
||||
# a reserved name; roster_read runs the same check on read so a forged
|
||||
# dir whose basename derives an illegal name can't pass.
|
||||
|
|
@ -649,7 +649,7 @@ EOF
|
|||
}
|
||||
|
||||
@test "cmd_list skips parties whose tmux list-clients fails" {
|
||||
# SERVER_PID liveness alone doesn't prove a party is real — init's PID 1
|
||||
# SERVER_PID liveness alone doesn't prove a party is real: init's PID 1
|
||||
# always passes, and a non-tmux daemon (or `nc -lU`) can hold a real
|
||||
# AF_UNIX socket. cmd_list must run list-clients and treat non-zero as
|
||||
# "not a real party," skipping the entry rather than reporting it with
|
||||
|
|
@ -730,7 +730,7 @@ STUB
|
|||
# resolver. A roster can have a live SERVER_PID (PID reuse, init's pid 1)
|
||||
# and an [ -S ]-passing socket (planted via `nc -lU`) yet not be a real
|
||||
# tmux server. party_conn_state must probe list-clients on every resolver,
|
||||
# not just cmd_list — otherwise `party join
|
||||
# not just cmd_list, otherwise `party join
|
||||
# imposter` would resolve to the imposter and try to attach.
|
||||
legit_dir="$PARTY_SOCKET_DIR/party-$USER:legit2.d"
|
||||
mkdir -p "$legit_dir" && chmod 0750 "$legit_dir"
|
||||
|
|
@ -785,7 +785,7 @@ STUB
|
|||
# cmd_host MUST require server-access at runtime, not just in the
|
||||
# README. tmux < 3.3 doesn't support the command, and silently
|
||||
# swallowing its failure (the prior behavior) would degrade the auth
|
||||
# gate to nothing — group members with FS access could attach without
|
||||
# gate to nothing: group members with FS access could attach without
|
||||
# being invited.
|
||||
cat > "$PARTY_TMUX" <<'STUB'
|
||||
#!/bin/sh
|
||||
|
|
@ -804,7 +804,7 @@ case "$*" in
|
|||
echo "$FAKE_SERVER_PID"
|
||||
;;
|
||||
*"server-access "*)
|
||||
# Simulate tmux < 3.3 — command unknown.
|
||||
# Simulate tmux < 3.3: command unknown.
|
||||
echo "unknown command: server-access" >&2
|
||||
exit 1
|
||||
;;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue