ssh-net 26.9.20 → 26.9.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/libexec/commands/install.mjs +5 -2
- package/libexec/lib/probe.mjs +19 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,16 @@
|
|
|
9
9
|
故 26.9.12 之后跳号发 26.9.17(第 17 个包),13–16 永久空缺——序号从此与
|
|
10
10
|
第几个包严格一致,看到版本号即知发布总数
|
|
11
11
|
|
|
12
|
+
## [26.9.21] - 2026-09-30
|
|
13
|
+
|
|
14
|
+
### 变更(install 预检按地址族收窄,修 26.9.20 的误伤)
|
|
15
|
+
|
|
16
|
+
- peer 全 v6 环回(26.9.20)后本服务只听 `[::1]:10022`,但 install 的
|
|
17
|
+
10022 预检仍按「整个端口任一族被占」拒绝——mb5 实案:VS Code 本地
|
|
18
|
+
端口转发占了 `127.0.0.1:10022`(v4),与本服务不同地址族可共存,却
|
|
19
|
+
被误伤拒装。现预检只盯 `[::1]:10022` 的持有者(v6 被异物/zombie 占用
|
|
20
|
+
照拒),v4 同名端口不再拦
|
|
21
|
+
|
|
12
22
|
## [26.9.20] - 2026-09-30
|
|
13
23
|
|
|
14
24
|
### 变更(peer 全 v6 环回 + statusline 链路前缀的构造保证;sn-v6 改名 sn-ipv6)
|
|
@@ -11,7 +11,8 @@ import { ensureRuntime } from '../lib/runtime.mjs';
|
|
|
11
11
|
import * as launchd from '../lib/launchd.mjs';
|
|
12
12
|
import * as systemd from '../lib/systemd.mjs';
|
|
13
13
|
import {
|
|
14
|
-
classifyLocalPort,
|
|
14
|
+
classifyLocalPort, listV6LoopbackListeners,
|
|
15
|
+
peerProbeOk, detectTerminalNotifier,
|
|
15
16
|
} from '../lib/probe.mjs';
|
|
16
17
|
import {
|
|
17
18
|
linkLabel, linkLinkName,
|
|
@@ -35,8 +36,10 @@ async function precheckEdgePorts(ctx) {
|
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
// 10022 持口者永远是本机 sshd,无法按 pid 溯源:读到 SSH banner 才认。
|
|
39
|
+
// 只盯 [::1](peer 全 v6 环回后的本服务监听面;127.0.0.1:10022 的持有
|
|
40
|
+
// 者如 VS Code 本地转发与本服务可共存,2026-09-30 起不判冲突——mb5 实案)。
|
|
38
41
|
// 首装时 bin/sn-probe 还没拷上,探针缺失不判僵尸(install 随后就拷)
|
|
39
|
-
const holders =
|
|
42
|
+
const holders = listV6LoopbackListeners(runner, CALLBACK_PORT);
|
|
40
43
|
if (
|
|
41
44
|
holders.length > 0
|
|
42
45
|
&& fs.existsSync(path.join(paths.binDir, 'sn-probe'))
|
package/libexec/lib/probe.mjs
CHANGED
|
@@ -47,6 +47,25 @@ export function listListeners(runner, port) {
|
|
|
47
47
|
.filter((n) => Number.isInteger(n));
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
/**
|
|
51
|
+
* 端口的 v6 环回([::1])监听者 pid 列表(peer 回拨口专用,2026-09-30 起
|
|
52
|
+
* 10022 只听 [::1])。v4 环回(127.0.0.1)上的同名端口持有者——如 VS Code
|
|
53
|
+
* 本地转发——与本服务不同地址族、可共存,不算冲突。用全输出 lsof 按
|
|
54
|
+
* `[::1]:<port>` 行过滤(lsof 的 -iTCP@ 过滤对 v6 字面量支持不稳)。
|
|
55
|
+
* @param {import('./exec.mjs').Runner} runner
|
|
56
|
+
* @param {number} port
|
|
57
|
+
* @returns {number[]}
|
|
58
|
+
*/
|
|
59
|
+
export function listV6LoopbackListeners(runner, port) {
|
|
60
|
+
const r = runner.run('lsof', ['-nP', `-iTCP:${port}`, '-sTCP:LISTEN']);
|
|
61
|
+
if (r.code !== 0) return [];
|
|
62
|
+
return r.stdout
|
|
63
|
+
.split('\n')
|
|
64
|
+
.filter((l) => l.includes(`[::1]:${port}`))
|
|
65
|
+
.map((l) => Number(l.match(/\s(\d+)\s/)?.[1]))
|
|
66
|
+
.filter((n) => Number.isInteger(n));
|
|
67
|
+
}
|
|
68
|
+
|
|
50
69
|
/**
|
|
51
70
|
* 全机 pid→ppid 表。
|
|
52
71
|
* @param {import('./exec.mjs').Runner} runner
|