rightsize 0.7.9 → 0.7.12
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/README.md +6 -4
- package/dist/backend-docker/backend.d.ts +29 -3
- package/dist/backend-docker/backend.d.ts.map +1 -1
- package/dist/backend-docker/backend.js +30 -3
- package/dist/backend-docker/backend.js.map +1 -1
- package/dist/backend-msb/backend.d.ts +657 -83
- package/dist/backend-msb/backend.d.ts.map +1 -1
- package/dist/backend-msb/backend.js +1319 -149
- package/dist/backend-msb/backend.js.map +1 -1
- package/dist/backend-msb/commands.d.ts +162 -16
- package/dist/backend-msb/commands.d.ts.map +1 -1
- package/dist/backend-msb/commands.js +228 -32
- package/dist/backend-msb/commands.js.map +1 -1
- package/dist/backend-msb/network-links.d.ts +86 -1
- package/dist/backend-msb/network-links.d.ts.map +1 -1
- package/dist/backend-msb/network-links.js +119 -4
- package/dist/backend-msb/network-links.js.map +1 -1
- package/dist/backend-msb/provisioner.d.ts +1 -1
- package/dist/backend-msb/provisioner.d.ts.map +1 -1
- package/dist/backend-msb/provisioner.js +1 -1
- package/dist/backend-msb/provisioner.js.map +1 -1
- package/dist/backend-msb/restore-access-denied.d.ts +50 -0
- package/dist/backend-msb/restore-access-denied.d.ts.map +1 -0
- package/dist/backend-msb/restore-access-denied.js +52 -0
- package/dist/backend-msb/restore-access-denied.js.map +1 -0
- package/dist/backend-msb/restore-broker.d.ts +181 -0
- package/dist/backend-msb/restore-broker.d.ts.map +1 -0
- package/dist/backend-msb/restore-broker.js +264 -0
- package/dist/backend-msb/restore-broker.js.map +1 -0
- package/dist/backend-msb/sandbox-already-exists.d.ts +32 -0
- package/dist/backend-msb/sandbox-already-exists.d.ts.map +1 -0
- package/dist/backend-msb/sandbox-already-exists.js +35 -0
- package/dist/backend-msb/sandbox-already-exists.js.map +1 -0
- package/dist/backend-msb/snapshot-create.d.ts +22 -0
- package/dist/backend-msb/snapshot-create.d.ts.map +1 -0
- package/dist/backend-msb/snapshot-create.js +33 -0
- package/dist/backend-msb/snapshot-create.js.map +1 -0
- package/dist/backend-msb/snapshot-import.d.ts +30 -14
- package/dist/backend-msb/snapshot-import.d.ts.map +1 -1
- package/dist/backend-msb/snapshot-import.js +35 -17
- package/dist/backend-msb/snapshot-import.js.map +1 -1
- package/dist/backend-msb/snapshot-rm.d.ts +28 -0
- package/dist/backend-msb/snapshot-rm.d.ts.map +1 -0
- package/dist/backend-msb/snapshot-rm.js +30 -0
- package/dist/backend-msb/snapshot-rm.js.map +1 -0
- package/dist/core/backend.d.ts +68 -23
- package/dist/core/backend.d.ts.map +1 -1
- package/dist/core/checkpoint/api.d.ts +2 -2
- package/dist/core/checkpoint/api.js +2 -2
- package/dist/core/checkpoint/registry.d.ts +46 -0
- package/dist/core/checkpoint/registry.d.ts.map +1 -1
- package/dist/core/checkpoint/registry.js +44 -3
- package/dist/core/checkpoint/registry.js.map +1 -1
- package/dist/core/errors.d.ts +49 -0
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +61 -0
- package/dist/core/errors.js.map +1 -1
- package/dist/core/free-ports.d.ts +18 -0
- package/dist/core/free-ports.d.ts.map +1 -1
- package/dist/core/free-ports.js +61 -0
- package/dist/core/free-ports.js.map +1 -1
- package/dist/core/generic-container.d.ts +101 -12
- package/dist/core/generic-container.d.ts.map +1 -1
- package/dist/core/generic-container.js +399 -71
- package/dist/core/generic-container.js.map +1 -1
- package/dist/core/model.d.ts +40 -3
- package/dist/core/model.d.ts.map +1 -1
- package/dist/core/network.d.ts +6 -2
- package/dist/core/network.d.ts.map +1 -1
- package/dist/core/network.js +4 -1
- package/dist/core/network.js.map +1 -1
- package/dist/core/reuse/hash.d.ts +12 -0
- package/dist/core/reuse/hash.d.ts.map +1 -1
- package/dist/core/reuse/hash.js +1 -0
- package/dist/core/reuse/hash.js.map +1 -1
- package/dist/core/reuse/registry.d.ts +10 -1
- package/dist/core/reuse/registry.d.ts.map +1 -1
- package/dist/core/reuse/registry.js +15 -1
- package/dist/core/reuse/registry.js.map +1 -1
- package/dist/core/sandbox-name.d.ts +3 -0
- package/dist/core/sandbox-name.d.ts.map +1 -0
- package/dist/core/sandbox-name.js +19 -0
- package/dist/core/sandbox-name.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/modules/cassandra.d.ts +12 -12
- package/dist/modules/cassandra.js +13 -13
- package/dist/modules/cassandra.js.map +1 -1
- package/dist/modules/minio.d.ts +5 -3
- package/dist/modules/minio.d.ts.map +1 -1
- package/dist/modules/minio.js +14 -4
- package/dist/modules/minio.js.map +1 -1
- package/dist/modules/postgres.d.ts +2 -2
- package/dist/modules/postgres.d.ts.map +1 -1
- package/dist/modules/postgres.js +11 -9
- package/dist/modules/postgres.js.map +1 -1
- package/package.json +1 -1
- package/dist/backend-msb/snapshot-list.d.ts +0 -43
- package/dist/backend-msb/snapshot-list.d.ts.map +0 -1
- package/dist/backend-msb/snapshot-list.js +0 -53
- package/dist/backend-msb/snapshot-list.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provisioner.js","sourceRoot":"","sources":["../../src/backend-msb/provisioner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C;;;;GAIG;A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output` (an `msb restore` invocation's combined stdout+stderr)
|
|
3
|
+
* carries a Windows `ERROR_ACCESS_DENIED` against the just-written snapshot
|
|
4
|
+
* artifact it was asked to restore. Captured shape (mirrors
|
|
5
|
+
* `isSnapshotSaveAccessDeniedFailure`'s own Windows fsync failure, a
|
|
6
|
+
* sibling access-denied signature on the SAME artifact class, one step
|
|
7
|
+
* earlier in the checkpoint cycle):
|
|
8
|
+
*
|
|
9
|
+
* ```text
|
|
10
|
+
* error: io error: Access is denied. (os error 5)
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* Observed on Windows CI immediately after the source sandbox's own
|
|
14
|
+
* teardown in the stop/snapshot/reboot checkpoint cycle — msb's docs
|
|
15
|
+
* describe deferred file-handle release on Windows, and the just-written
|
|
16
|
+
* snapshot artifact (or the block device backing the restored sandbox
|
|
17
|
+
* itself — unix's twin of this same class of failure is a block-device open
|
|
18
|
+
* `PermissionDenied`, os error 13) can still be mid-release by the OS for a
|
|
19
|
+
* brief window right after the process that wrote it (or the one that just
|
|
20
|
+
* stopped the source sandbox) exits. Retrying the SAME `--name` does not
|
|
21
|
+
* simply wait that lag out, though: EMPIRICALLY VERIFIED against a real msb
|
|
22
|
+
* 0.7.1 binary, this failure happens AFTER msb's own artifact validation —
|
|
23
|
+
* which leaves `--name` behind as a STOPPED SANDBOX RECORD — so a same-name
|
|
24
|
+
* retry collides with msb's own restore-time collision check immediately,
|
|
25
|
+
* rather than ever getting a second shot at the transient (see
|
|
26
|
+
* `MsbCliBackend`'s own doc on `CHECKPOINT_REBOOT_ALREADY_EXISTS_RETRY_BUDGET_MS`
|
|
27
|
+
* for the full live-verified account). `MsbCliBackend.retryRestoreAfterAccessDenied`
|
|
28
|
+
* (the ordinary `start()`/`fromCheckpoint().start()` path) and
|
|
29
|
+
* `MsbCliBackend.rebootUnderFreshName` (`createCheckpoint`'s own reboot)
|
|
30
|
+
* both retry a restore that hits this a bounded number of times, each under
|
|
31
|
+
* a FRESH name rather than the one that just failed (see
|
|
32
|
+
* `RESTORE_ACCESS_DENIED_RETRY_LIMIT`/`RESTORE_ACCESS_DENIED_RETRY_DELAY_MS`
|
|
33
|
+
* for the former's own budget/delay) rather than surfacing it as an
|
|
34
|
+
* ordinary restore failure on the first hit.
|
|
35
|
+
*
|
|
36
|
+
* Matches CONSERVATIVELY — both `"Access is denied"` (Windows' own
|
|
37
|
+
* `FormatMessage` text for `ERROR_ACCESS_DENIED`, present regardless of the
|
|
38
|
+
* machine's display language in every capture seen so far) AND one of
|
|
39
|
+
* `"io error"` (the Rust error variant wrapping it) or `"os error 5"` (the
|
|
40
|
+
* numeric errno Rust appends) must be present — reducing the chance of
|
|
41
|
+
* matching some unrelated "access denied" phrasing (a genuine permission
|
|
42
|
+
* error, say) that happens to share only one of the two phrases. Nothing
|
|
43
|
+
* here is Windows-specific by construction — the signature simply never
|
|
44
|
+
* occurs on unix, so the platform check some callers might expect isn't
|
|
45
|
+
* needed at the match site — which also keeps this exercisable by unit
|
|
46
|
+
* tests on any host, the same rationale `salvageStagedArchive` documents for
|
|
47
|
+
* its own platform-agnostic helper.
|
|
48
|
+
*/
|
|
49
|
+
export declare function isRestoreAccessDeniedFailure(output: string): boolean;
|
|
50
|
+
//# sourceMappingURL=restore-access-denied.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restore-access-denied.d.ts","sourceRoot":"","sources":["../../src/backend-msb/restore-access-denied.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEpE"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* True if `output` (an `msb restore` invocation's combined stdout+stderr)
|
|
3
|
+
* carries a Windows `ERROR_ACCESS_DENIED` against the just-written snapshot
|
|
4
|
+
* artifact it was asked to restore. Captured shape (mirrors
|
|
5
|
+
* `isSnapshotSaveAccessDeniedFailure`'s own Windows fsync failure, a
|
|
6
|
+
* sibling access-denied signature on the SAME artifact class, one step
|
|
7
|
+
* earlier in the checkpoint cycle):
|
|
8
|
+
*
|
|
9
|
+
* ```text
|
|
10
|
+
* error: io error: Access is denied. (os error 5)
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* Observed on Windows CI immediately after the source sandbox's own
|
|
14
|
+
* teardown in the stop/snapshot/reboot checkpoint cycle — msb's docs
|
|
15
|
+
* describe deferred file-handle release on Windows, and the just-written
|
|
16
|
+
* snapshot artifact (or the block device backing the restored sandbox
|
|
17
|
+
* itself — unix's twin of this same class of failure is a block-device open
|
|
18
|
+
* `PermissionDenied`, os error 13) can still be mid-release by the OS for a
|
|
19
|
+
* brief window right after the process that wrote it (or the one that just
|
|
20
|
+
* stopped the source sandbox) exits. Retrying the SAME `--name` does not
|
|
21
|
+
* simply wait that lag out, though: EMPIRICALLY VERIFIED against a real msb
|
|
22
|
+
* 0.7.1 binary, this failure happens AFTER msb's own artifact validation —
|
|
23
|
+
* which leaves `--name` behind as a STOPPED SANDBOX RECORD — so a same-name
|
|
24
|
+
* retry collides with msb's own restore-time collision check immediately,
|
|
25
|
+
* rather than ever getting a second shot at the transient (see
|
|
26
|
+
* `MsbCliBackend`'s own doc on `CHECKPOINT_REBOOT_ALREADY_EXISTS_RETRY_BUDGET_MS`
|
|
27
|
+
* for the full live-verified account). `MsbCliBackend.retryRestoreAfterAccessDenied`
|
|
28
|
+
* (the ordinary `start()`/`fromCheckpoint().start()` path) and
|
|
29
|
+
* `MsbCliBackend.rebootUnderFreshName` (`createCheckpoint`'s own reboot)
|
|
30
|
+
* both retry a restore that hits this a bounded number of times, each under
|
|
31
|
+
* a FRESH name rather than the one that just failed (see
|
|
32
|
+
* `RESTORE_ACCESS_DENIED_RETRY_LIMIT`/`RESTORE_ACCESS_DENIED_RETRY_DELAY_MS`
|
|
33
|
+
* for the former's own budget/delay) rather than surfacing it as an
|
|
34
|
+
* ordinary restore failure on the first hit.
|
|
35
|
+
*
|
|
36
|
+
* Matches CONSERVATIVELY — both `"Access is denied"` (Windows' own
|
|
37
|
+
* `FormatMessage` text for `ERROR_ACCESS_DENIED`, present regardless of the
|
|
38
|
+
* machine's display language in every capture seen so far) AND one of
|
|
39
|
+
* `"io error"` (the Rust error variant wrapping it) or `"os error 5"` (the
|
|
40
|
+
* numeric errno Rust appends) must be present — reducing the chance of
|
|
41
|
+
* matching some unrelated "access denied" phrasing (a genuine permission
|
|
42
|
+
* error, say) that happens to share only one of the two phrases. Nothing
|
|
43
|
+
* here is Windows-specific by construction — the signature simply never
|
|
44
|
+
* occurs on unix, so the platform check some callers might expect isn't
|
|
45
|
+
* needed at the match site — which also keeps this exercisable by unit
|
|
46
|
+
* tests on any host, the same rationale `salvageStagedArchive` documents for
|
|
47
|
+
* its own platform-agnostic helper.
|
|
48
|
+
*/
|
|
49
|
+
export function isRestoreAccessDeniedFailure(output) {
|
|
50
|
+
return output.includes("Access is denied") && (output.includes("io error") || output.includes("os error 5"));
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=restore-access-denied.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restore-access-denied.js","sourceRoot":"","sources":["../../src/backend-msb/restore-access-denied.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,UAAU,4BAA4B,CAAC,MAAc;IACzD,OAAO,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;AAC/G,CAAC"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Windows-only job-object-breakaway problem this whole module exists to
|
|
3
|
+
* route around. EMPIRICALLY VERIFIED across a four-round live diagnostic
|
|
4
|
+
* campaign on Windows CI (2026-09-18): msb's detached spawn on Windows
|
|
5
|
+
* (`sdk/rust/lib/runtime/spawn.rs`, msb 0.7.1/0.7.2) always passes
|
|
6
|
+
* `DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP | CREATE_BREAKAWAY_FROM_JOB`
|
|
7
|
+
* when it launches the new `msb.exe` that supervises a restored sandbox —
|
|
8
|
+
* `msb restore` is detached-by-design (see `MsbCliBackend.bootRestoreOnce`'s
|
|
9
|
+
* own doc), so it must spawn that new process every time. When the CALLING
|
|
10
|
+
* `msb.exe` itself sits inside a Windows job object that was never granted
|
|
11
|
+
* `JOB_OBJECT_LIMIT_BREAKAWAY_OK`, `CreateProcess` fails outright with
|
|
12
|
+
* `ERROR_ACCESS_DENIED`, and msb surfaces the bare `error: io error: Access
|
|
13
|
+
* is denied. (os error 5)` — the exact signature `isRestoreAccessDeniedFailure`
|
|
14
|
+
* matches, previously attributed entirely to a Windows file-handle release
|
|
15
|
+
* lag. Direct probes at failure time ruled the lag theory out: no msb.exe
|
|
16
|
+
* processes alive, the artifact readable/writable/hardlinkable from another
|
|
17
|
+
* process, nothing locked — the denial is the spawn itself, not the file.
|
|
18
|
+
*
|
|
19
|
+
* Gradle test workers and cargo-test binaries run inside exactly such
|
|
20
|
+
* breakaway-denying job objects (`inJob=True, limitFlags=0x0`, live-probed),
|
|
21
|
+
* which is why the sibling rust/kotlin libraries hit this deterministically
|
|
22
|
+
* on their own Windows CI while this repository's node test workers —
|
|
23
|
+
* confirmed to add no such job object — never have.
|
|
24
|
+
*
|
|
25
|
+
* THE MITIGATION IS LIVE-VALIDATED: the identical `msb restore <artifact>
|
|
26
|
+
* --name X` launched through WMI (`Invoke-CimMethod -ClassName Win32_Process
|
|
27
|
+
* -MethodName Create`), whose children run under `WmiPrvSE` OUTSIDE the
|
|
28
|
+
* caller's job hierarchy, returns `ReturnValue=0` and the restored sandbox
|
|
29
|
+
* shows Running in `msb ls` — reproduced in two separate cycles in the exact
|
|
30
|
+
* environment where a direct spawn is denied every time.
|
|
31
|
+
*
|
|
32
|
+
* This module is the resulting escape hatch: `realRestoreBroker` shells the
|
|
33
|
+
* exact same `msb restore ...` invocation through a WMI-created process
|
|
34
|
+
* instead of a direct child, for the callers in `backend.ts`
|
|
35
|
+
* (`rebootUnderFreshName`/`retryRestoreAfterAccessDenied`) that escalate to
|
|
36
|
+
* it once — and only once — a restore attempt on a Windows host hits that
|
|
37
|
+
* classified access-denied failure (POLICY v2; see those methods' own doc).
|
|
38
|
+
* It changes nothing for a healthy environment: the first attempt of any
|
|
39
|
+
* reboot is always a direct spawn, and a host that never hits the access-
|
|
40
|
+
* denied signature never touches this module at all.
|
|
41
|
+
*/
|
|
42
|
+
/** One brokered restore attempt whose own outcome was captured — classify `output` with the exact same predicates a direct attempt's output goes through. */
|
|
43
|
+
export interface RestoreBrokerCompleted {
|
|
44
|
+
kind: "completed";
|
|
45
|
+
exitCode: number;
|
|
46
|
+
output: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The broker's own `ecFile` (see `buildOuterBrokerScript`) never appeared
|
|
50
|
+
* within its bounded wait, so no exit code/output could be read back — but
|
|
51
|
+
* the WMI `Create` call itself was accepted (`ReturnValue=0`), so the
|
|
52
|
+
* restore may well be running in the background regardless. The caller
|
|
53
|
+
* (`MsbCliBackend.bootRestoreOnce`) treats this exactly like a confirmed
|
|
54
|
+
* exit 0: skip classification and fall through to its own `msb ls`
|
|
55
|
+
* readiness poll, which — being activation-gated — settles the question on
|
|
56
|
+
* its own either way.
|
|
57
|
+
*/
|
|
58
|
+
export interface RestoreBrokerUnconfirmed {
|
|
59
|
+
kind: "unconfirmed";
|
|
60
|
+
}
|
|
61
|
+
export type RestoreBrokerResult = RestoreBrokerCompleted | RestoreBrokerUnconfirmed;
|
|
62
|
+
/**
|
|
63
|
+
* The injectable seam `MsbCliBackend` calls through for every brokered
|
|
64
|
+
* restore attempt — `msbPath`/`argv` are exactly what a direct attempt would
|
|
65
|
+
* spawn (`MsbCommands.restore(spec)`'s own argv, unmodified), `timeoutMs` the
|
|
66
|
+
* same boot budget a direct attempt is held to. Rejects only for a broker-
|
|
67
|
+
* INFRASTRUCTURE failure (missing `powershell.exe`, a script-file write
|
|
68
|
+
* failure, WMI refusing to even create the process) — the caller falls back
|
|
69
|
+
* to a direct attempt on a rejection (POLICY v2 point 5: the broker must
|
|
70
|
+
* never become a new single point of failure). Resolves for every other
|
|
71
|
+
* outcome, including the brokered restore itself failing (access-denied
|
|
72
|
+
* again, an "already exists" collision, or any other msb refusal) — that is
|
|
73
|
+
* ordinary classified output for the caller to interpret, not a broker
|
|
74
|
+
* failure.
|
|
75
|
+
*/
|
|
76
|
+
export type RestoreBrokerLauncher = (msbPath: string, argv: readonly string[], timeoutMs: number) => Promise<RestoreBrokerResult>;
|
|
77
|
+
/**
|
|
78
|
+
* Doubles every embedded `'` so `value` can be dropped verbatim into a
|
|
79
|
+
* PowerShell single-quoted string literal (`'...'`) — PowerShell's own
|
|
80
|
+
* escaping rule for that quoting style, the same one a hand-written `''`
|
|
81
|
+
* inside a single-quoted string represents a literal `'`. Applied to every
|
|
82
|
+
* interpolated value this module builds a script around (the msb binary
|
|
83
|
+
* path, every restore argv token, and the temp out/ec file paths) — never
|
|
84
|
+
* only the ones expected to need it, since a caller-controlled mount path or
|
|
85
|
+
* artifact ref is exactly the kind of value that might one day carry one.
|
|
86
|
+
*/
|
|
87
|
+
export declare function escapePowerShellSingleQuoted(value: string): string;
|
|
88
|
+
/**
|
|
89
|
+
* The script text the WMI-created powershell process itself runs: the real
|
|
90
|
+
* `msb <argv>` invocation (the call operator `&`, since `msbPath` is a
|
|
91
|
+
* runtime string, not a literal command name), its combined stdout+stderr
|
|
92
|
+
* merged into `outFile` via PowerShell's `*>` all-streams redirection —
|
|
93
|
+
* mirroring `fetchStdoutExact`'s own reason for treating stdout+stderr as
|
|
94
|
+
* one channel — followed by writing the invocation's own `$LASTEXITCODE` to
|
|
95
|
+
* `ecFile`. Both files are how this reaches back across the WMI boundary:
|
|
96
|
+
* `Invoke-CimMethod`'s `Create` has no stdout/exit-code channel of its own
|
|
97
|
+
* (it returns only a `ProcessId` and a `ReturnValue` for the CREATE call
|
|
98
|
+
* itself, never anything about what that process goes on to do). Every path
|
|
99
|
+
* and argv token is its own single-quoted literal (`quoteSingle`) — never
|
|
100
|
+
* string-interpolated — so a value carrying spaces, `$`, or a literal `'`
|
|
101
|
+
* (an exotic mount path, in principle) round-trips as data, not script
|
|
102
|
+
* syntax.
|
|
103
|
+
*/
|
|
104
|
+
export declare function buildInnerRestoreScript(msbPath: string, argv: readonly string[], outFile: string, ecFile: string): string;
|
|
105
|
+
/**
|
|
106
|
+
* Encodes `script` the way `powershell -EncodedCommand` requires: UTF-16LE
|
|
107
|
+
* bytes, base64. Chosen over `-Command "<script>"` specifically to sidestep
|
|
108
|
+
* a second layer of quote-escaping entirely — `buildInnerRestoreScript`'s
|
|
109
|
+
* own output already carries single-quoted literals of its own, and nesting
|
|
110
|
+
* that inside ANOTHER quoted string (the `CommandLine` this module hands to
|
|
111
|
+
* `Invoke-CimMethod`) would mean escaping quotes-within-quotes-within-quotes.
|
|
112
|
+
* A base64 payload is alphanumeric-plus-`+/=` only, so embedding it inside
|
|
113
|
+
* the OUTER script's own single-quoted `CommandLine` literal (see
|
|
114
|
+
* `buildOuterBrokerScript`) needs no escaping of its own at all.
|
|
115
|
+
*/
|
|
116
|
+
export declare function encodeAsEncodedCommand(script: string): string;
|
|
117
|
+
/** How long `buildOuterBrokerScript`'s own polling loop waits for `ecFile` to appear before giving up and letting the caller fall through to its own `msb ls` readiness poll (see `RestoreBrokerUnconfirmed`'s own doc) — generous for `msb restore`'s own detach, which the rest of this codebase documents as "typically within seconds". */
|
|
118
|
+
export declare const RESTORE_BROKER_ECFILE_WAIT_SECONDS = 30;
|
|
119
|
+
/**
|
|
120
|
+
* The OUTER script — the one actually run as `powershell -NoProfile -File
|
|
121
|
+
* <script>` (see `realRestoreBroker`) — that performs the WMI escape itself
|
|
122
|
+
* and reports back what happened, all through plain stdout this module's own
|
|
123
|
+
* node-side caller can read directly (no temp file needed for THIS layer,
|
|
124
|
+
* unlike the inner restore's own output — this process's stdout pipe is
|
|
125
|
+
* ordinary, since it is never the one msb's job object would deny).
|
|
126
|
+
*
|
|
127
|
+
* `encodedInner` (see `encodeAsEncodedCommand`) is embedded inside this
|
|
128
|
+
* script's own single-quoted `$cmdLine` literal — safe with no escaping of
|
|
129
|
+
* its own, being pure base64 — as the `-EncodedCommand` argument of the
|
|
130
|
+
* powershell invocation `Invoke-CimMethod` launches. `outFile`/`ecFile` are
|
|
131
|
+
* each their own single-quoted literal via `quoteSingle`, the same as every
|
|
132
|
+
* path `buildInnerRestoreScript` embeds.
|
|
133
|
+
*
|
|
134
|
+
* `powershell.exe` (never the bare `powershell`, nor `pwsh`) both here and as
|
|
135
|
+
* the WMI-launched process's own executable — the task this whole module
|
|
136
|
+
* exists for names it explicitly "for maximum compatibility": every
|
|
137
|
+
* supported Windows release ships Windows PowerShell under that exact name,
|
|
138
|
+
* while PowerShell 7 (`pwsh`) is an opt-in install this backend has no
|
|
139
|
+
* business depending on.
|
|
140
|
+
*/
|
|
141
|
+
export declare function buildOuterBrokerScript(params: {
|
|
142
|
+
encodedInner: string;
|
|
143
|
+
outFile: string;
|
|
144
|
+
ecFile: string;
|
|
145
|
+
waitSeconds?: number;
|
|
146
|
+
}): string;
|
|
147
|
+
export interface ParsedBrokerScriptOutput {
|
|
148
|
+
/** The WMI `Create` call's own `ReturnValue` (0 == accepted), or `undefined` if the marker line itself never showed up (the outer script died before printing it). */
|
|
149
|
+
returnValue: number | undefined;
|
|
150
|
+
/** The WMI-created process's own pid, purely diagnostic — never load-bearing for classification. */
|
|
151
|
+
processId: number | undefined;
|
|
152
|
+
/** `outFile`'s contents (the brokered `msb restore`'s combined stdout+stderr), or `undefined` if `outFile` never existed when the outer script checked. */
|
|
153
|
+
outText: string | undefined;
|
|
154
|
+
/** `ecFile`'s contents (the brokered invocation's own `$LASTEXITCODE`, as text), or `undefined` if it never appeared within the wait bound. */
|
|
155
|
+
ecText: string | undefined;
|
|
156
|
+
}
|
|
157
|
+
/** Parses `buildOuterBrokerScript`'s own stdout back into its four parts — see `ParsedBrokerScriptOutput`'s own doc on each field. Tolerant of CRLF (PowerShell's own native line ending) and of any marker being absent, since the outer script can die (or its own wait bound expire) after printing only some of them. */
|
|
158
|
+
export declare function parseBrokerScriptOutput(stdout: string): ParsedBrokerScriptOutput;
|
|
159
|
+
/**
|
|
160
|
+
* The real, production `RestoreBrokerLauncher` — writes the outer script
|
|
161
|
+
* (see `buildOuterBrokerScript`) to a unique temp file, runs it via
|
|
162
|
+
* `powershell.exe -NoProfile -NonInteractive -File <script>`, and turns its
|
|
163
|
+
* parsed output (`parseBrokerScriptOutput`) into a `RestoreBrokerResult`:
|
|
164
|
+
*
|
|
165
|
+
* - WMI's own `ReturnValue` missing or non-zero (the process was never even
|
|
166
|
+
* created) throws — broker-infrastructure failure, per this function's own
|
|
167
|
+
* `RestoreBrokerLauncher` contract, for the caller to catch and fall back
|
|
168
|
+
* to a direct attempt.
|
|
169
|
+
* - `ecFile` never read back (`ecText === undefined`, or unparsable as an
|
|
170
|
+
* integer) resolves `{ kind: "unconfirmed" }` — see that type's own doc.
|
|
171
|
+
* - Otherwise resolves `{ kind: "completed", exitCode, output: outText ?? ""
|
|
172
|
+
* }` — the brokered restore's own result, for the caller to classify
|
|
173
|
+
* exactly like a direct attempt's.
|
|
174
|
+
*
|
|
175
|
+
* Every temp file (script, `outFile`, `ecFile`) is unique per call
|
|
176
|
+
* (`randomBytes`-suffixed, under `os.tmpdir()`) and best-effort removed in a
|
|
177
|
+
* `finally` — cleanup failures are swallowed, never allowed to mask the real
|
|
178
|
+
* outcome above.
|
|
179
|
+
*/
|
|
180
|
+
export declare const realRestoreBroker: RestoreBrokerLauncher;
|
|
181
|
+
//# sourceMappingURL=restore-broker.d.ts.map
|
|
@@ -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tB,GAAG,MAAM,CAwBT;AAED,MAAM,WAAW,wBAAwB;IACvC,sKAAsK;IACtK,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,oGAAoG;IACpG,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,2JAA2J;IAC3J,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,+IAA+I;IAC/I,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAkCD,6TAA6T;AAC7T,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,wBAAwB,CAShF;AAoDD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,iBAAiB,EAAE,qBA2C/B,CAAC"}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { randomBytes } from "node:crypto";
|
|
3
|
+
import * as fs from "node:fs/promises";
|
|
4
|
+
import * as os from "node:os";
|
|
5
|
+
import * as path from "node:path";
|
|
6
|
+
import { CLOSED_STDIN } from "./invoke.js";
|
|
7
|
+
/**
|
|
8
|
+
* Doubles every embedded `'` so `value` can be dropped verbatim into a
|
|
9
|
+
* PowerShell single-quoted string literal (`'...'`) — PowerShell's own
|
|
10
|
+
* escaping rule for that quoting style, the same one a hand-written `''`
|
|
11
|
+
* inside a single-quoted string represents a literal `'`. Applied to every
|
|
12
|
+
* interpolated value this module builds a script around (the msb binary
|
|
13
|
+
* path, every restore argv token, and the temp out/ec file paths) — never
|
|
14
|
+
* only the ones expected to need it, since a caller-controlled mount path or
|
|
15
|
+
* artifact ref is exactly the kind of value that might one day carry one.
|
|
16
|
+
*/
|
|
17
|
+
export function escapePowerShellSingleQuoted(value) {
|
|
18
|
+
return value.replace(/'/g, "''");
|
|
19
|
+
}
|
|
20
|
+
/** `value` wrapped as its own single-quoted PowerShell literal (see `escapePowerShellSingleQuoted`). */
|
|
21
|
+
function quoteSingle(value) {
|
|
22
|
+
return `'${escapePowerShellSingleQuoted(value)}'`;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The script text the WMI-created powershell process itself runs: the real
|
|
26
|
+
* `msb <argv>` invocation (the call operator `&`, since `msbPath` is a
|
|
27
|
+
* runtime string, not a literal command name), its combined stdout+stderr
|
|
28
|
+
* merged into `outFile` via PowerShell's `*>` all-streams redirection —
|
|
29
|
+
* mirroring `fetchStdoutExact`'s own reason for treating stdout+stderr as
|
|
30
|
+
* one channel — followed by writing the invocation's own `$LASTEXITCODE` to
|
|
31
|
+
* `ecFile`. Both files are how this reaches back across the WMI boundary:
|
|
32
|
+
* `Invoke-CimMethod`'s `Create` has no stdout/exit-code channel of its own
|
|
33
|
+
* (it returns only a `ProcessId` and a `ReturnValue` for the CREATE call
|
|
34
|
+
* itself, never anything about what that process goes on to do). Every path
|
|
35
|
+
* and argv token is its own single-quoted literal (`quoteSingle`) — never
|
|
36
|
+
* string-interpolated — so a value carrying spaces, `$`, or a literal `'`
|
|
37
|
+
* (an exotic mount path, in principle) round-trips as data, not script
|
|
38
|
+
* syntax.
|
|
39
|
+
*/
|
|
40
|
+
export function buildInnerRestoreScript(msbPath, argv, outFile, ecFile) {
|
|
41
|
+
const quotedArgv = argv.map(quoteSingle).join(" ");
|
|
42
|
+
return [
|
|
43
|
+
`& ${quoteSingle(msbPath)} ${quotedArgv} *> ${quoteSingle(outFile)}`,
|
|
44
|
+
`Set-Content -LiteralPath ${quoteSingle(ecFile)} -Value $LASTEXITCODE -NoNewline`,
|
|
45
|
+
].join("\n");
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Encodes `script` the way `powershell -EncodedCommand` requires: UTF-16LE
|
|
49
|
+
* bytes, base64. Chosen over `-Command "<script>"` specifically to sidestep
|
|
50
|
+
* a second layer of quote-escaping entirely — `buildInnerRestoreScript`'s
|
|
51
|
+
* own output already carries single-quoted literals of its own, and nesting
|
|
52
|
+
* that inside ANOTHER quoted string (the `CommandLine` this module hands to
|
|
53
|
+
* `Invoke-CimMethod`) would mean escaping quotes-within-quotes-within-quotes.
|
|
54
|
+
* A base64 payload is alphanumeric-plus-`+/=` only, so embedding it inside
|
|
55
|
+
* the OUTER script's own single-quoted `CommandLine` literal (see
|
|
56
|
+
* `buildOuterBrokerScript`) needs no escaping of its own at all.
|
|
57
|
+
*/
|
|
58
|
+
export function encodeAsEncodedCommand(script) {
|
|
59
|
+
return Buffer.from(script, "utf16le").toString("base64");
|
|
60
|
+
}
|
|
61
|
+
/** How long `buildOuterBrokerScript`'s own polling loop waits for `ecFile` to appear before giving up and letting the caller fall through to its own `msb ls` readiness poll (see `RestoreBrokerUnconfirmed`'s own doc) — generous for `msb restore`'s own detach, which the rest of this codebase documents as "typically within seconds". */
|
|
62
|
+
export const RESTORE_BROKER_ECFILE_WAIT_SECONDS = 30;
|
|
63
|
+
const RETURN_VALUE_PREFIX = "RIGHTSIZE-BROKER-RETURNVALUE=";
|
|
64
|
+
const PROCESS_ID_PREFIX = "RIGHTSIZE-BROKER-PROCESSID=";
|
|
65
|
+
const OUT_BEGIN = "RIGHTSIZE-BROKER-OUT-BEGIN";
|
|
66
|
+
const OUT_END = "RIGHTSIZE-BROKER-OUT-END";
|
|
67
|
+
const EC_BEGIN = "RIGHTSIZE-BROKER-EC-BEGIN";
|
|
68
|
+
const EC_END = "RIGHTSIZE-BROKER-EC-END";
|
|
69
|
+
/**
|
|
70
|
+
* The OUTER script — the one actually run as `powershell -NoProfile -File
|
|
71
|
+
* <script>` (see `realRestoreBroker`) — that performs the WMI escape itself
|
|
72
|
+
* and reports back what happened, all through plain stdout this module's own
|
|
73
|
+
* node-side caller can read directly (no temp file needed for THIS layer,
|
|
74
|
+
* unlike the inner restore's own output — this process's stdout pipe is
|
|
75
|
+
* ordinary, since it is never the one msb's job object would deny).
|
|
76
|
+
*
|
|
77
|
+
* `encodedInner` (see `encodeAsEncodedCommand`) is embedded inside this
|
|
78
|
+
* script's own single-quoted `$cmdLine` literal — safe with no escaping of
|
|
79
|
+
* its own, being pure base64 — as the `-EncodedCommand` argument of the
|
|
80
|
+
* powershell invocation `Invoke-CimMethod` launches. `outFile`/`ecFile` are
|
|
81
|
+
* each their own single-quoted literal via `quoteSingle`, the same as every
|
|
82
|
+
* path `buildInnerRestoreScript` embeds.
|
|
83
|
+
*
|
|
84
|
+
* `powershell.exe` (never the bare `powershell`, nor `pwsh`) both here and as
|
|
85
|
+
* the WMI-launched process's own executable — the task this whole module
|
|
86
|
+
* exists for names it explicitly "for maximum compatibility": every
|
|
87
|
+
* supported Windows release ships Windows PowerShell under that exact name,
|
|
88
|
+
* while PowerShell 7 (`pwsh`) is an opt-in install this backend has no
|
|
89
|
+
* business depending on.
|
|
90
|
+
*/
|
|
91
|
+
export function buildOuterBrokerScript(params) {
|
|
92
|
+
const { encodedInner, outFile, ecFile } = params;
|
|
93
|
+
const waitSeconds = params.waitSeconds ?? RESTORE_BROKER_ECFILE_WAIT_SECONDS;
|
|
94
|
+
return [
|
|
95
|
+
`$ErrorActionPreference = 'Stop'`,
|
|
96
|
+
`$cmdLine = 'powershell.exe -NoProfile -NonInteractive -WindowStyle Hidden -EncodedCommand ${encodedInner}'`,
|
|
97
|
+
`$create = Invoke-CimMethod -ClassName Win32_Process -MethodName Create -Arguments @{ CommandLine = $cmdLine }`,
|
|
98
|
+
`Write-Output "${RETURN_VALUE_PREFIX}$($create.ReturnValue)"`,
|
|
99
|
+
`Write-Output "${PROCESS_ID_PREFIX}$($create.ProcessId)"`,
|
|
100
|
+
`$deadline = (Get-Date).AddSeconds(${waitSeconds})`,
|
|
101
|
+
`while (-not (Test-Path -LiteralPath ${quoteSingle(ecFile)}) -and (Get-Date) -lt $deadline) {`,
|
|
102
|
+
` Start-Sleep -Milliseconds 250`,
|
|
103
|
+
`}`,
|
|
104
|
+
`if (Test-Path -LiteralPath ${quoteSingle(outFile)}) {`,
|
|
105
|
+
` Write-Output '${OUT_BEGIN}'`,
|
|
106
|
+
` Get-Content -LiteralPath ${quoteSingle(outFile)} -Raw`,
|
|
107
|
+
` Write-Output '${OUT_END}'`,
|
|
108
|
+
`}`,
|
|
109
|
+
`if (Test-Path -LiteralPath ${quoteSingle(ecFile)}) {`,
|
|
110
|
+
` Write-Output '${EC_BEGIN}'`,
|
|
111
|
+
` Get-Content -LiteralPath ${quoteSingle(ecFile)} -Raw`,
|
|
112
|
+
` Write-Output '${EC_END}'`,
|
|
113
|
+
`}`,
|
|
114
|
+
].join("\n");
|
|
115
|
+
}
|
|
116
|
+
function extractPrefixedInt(text, prefix) {
|
|
117
|
+
for (const line of text.split("\n")) {
|
|
118
|
+
const trimmed = line.trim();
|
|
119
|
+
if (trimmed.startsWith(prefix)) {
|
|
120
|
+
const parsed = Number.parseInt(trimmed.slice(prefix.length).trim(), 10);
|
|
121
|
+
return Number.isFinite(parsed) ? parsed : undefined;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return undefined;
|
|
125
|
+
}
|
|
126
|
+
function extractBetween(text, beginMarker, endMarker) {
|
|
127
|
+
const beginIdx = text.indexOf(beginMarker);
|
|
128
|
+
if (beginIdx === -1) {
|
|
129
|
+
return undefined;
|
|
130
|
+
}
|
|
131
|
+
const contentStart = text.indexOf("\n", beginIdx);
|
|
132
|
+
if (contentStart === -1) {
|
|
133
|
+
return undefined;
|
|
134
|
+
}
|
|
135
|
+
const endIdx = text.indexOf(endMarker, contentStart);
|
|
136
|
+
if (endIdx === -1) {
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
const raw = text.slice(contentStart + 1, endIdx);
|
|
140
|
+
// The captured content always carries exactly one trailing "\n" of its
|
|
141
|
+
// own — the line break between the last content line and the end
|
|
142
|
+
// marker's own line — which is an artifact of this scan, never part of
|
|
143
|
+
// what `Write-Output`/`Get-Content -Raw` actually produced; strip it.
|
|
144
|
+
return raw.endsWith("\n") ? raw.slice(0, -1) : raw;
|
|
145
|
+
}
|
|
146
|
+
/** Parses `buildOuterBrokerScript`'s own stdout back into its four parts — see `ParsedBrokerScriptOutput`'s own doc on each field. Tolerant of CRLF (PowerShell's own native line ending) and of any marker being absent, since the outer script can die (or its own wait bound expire) after printing only some of them. */
|
|
147
|
+
export function parseBrokerScriptOutput(stdout) {
|
|
148
|
+
const normalized = stdout.replace(/\r\n/g, "\n");
|
|
149
|
+
const ecText = extractBetween(normalized, EC_BEGIN, EC_END);
|
|
150
|
+
return {
|
|
151
|
+
returnValue: extractPrefixedInt(normalized, RETURN_VALUE_PREFIX),
|
|
152
|
+
processId: extractPrefixedInt(normalized, PROCESS_ID_PREFIX),
|
|
153
|
+
outText: extractBetween(normalized, OUT_BEGIN, OUT_END),
|
|
154
|
+
ecText: ecText?.trim(),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function runPowerShellFile(scriptFile, timeoutMs) {
|
|
158
|
+
return new Promise((resolveRun, rejectRun) => {
|
|
159
|
+
const child = spawn("powershell.exe", ["-NoProfile", "-NonInteractive", "-File", scriptFile], {
|
|
160
|
+
stdio: [CLOSED_STDIN, "pipe", "pipe"],
|
|
161
|
+
});
|
|
162
|
+
let stdout = "";
|
|
163
|
+
let stderr = "";
|
|
164
|
+
child.stdout.setEncoding("utf8");
|
|
165
|
+
child.stderr.setEncoding("utf8");
|
|
166
|
+
child.stdout.on("data", (chunk) => {
|
|
167
|
+
stdout += chunk;
|
|
168
|
+
});
|
|
169
|
+
child.stderr.on("data", (chunk) => {
|
|
170
|
+
stderr += chunk;
|
|
171
|
+
});
|
|
172
|
+
let settled = false;
|
|
173
|
+
const timer = setTimeout(() => {
|
|
174
|
+
if (settled) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
settled = true;
|
|
178
|
+
child.kill("SIGKILL");
|
|
179
|
+
rejectRun(new Error(`restore broker: its own powershell.exe driver did not exit within ${timeoutMs}ms`));
|
|
180
|
+
}, timeoutMs);
|
|
181
|
+
child.once("error", (err) => {
|
|
182
|
+
if (settled) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
settled = true;
|
|
186
|
+
clearTimeout(timer);
|
|
187
|
+
rejectRun(new Error(`restore broker: failed to spawn powershell.exe: ${err.message}`));
|
|
188
|
+
});
|
|
189
|
+
child.once("close", () => {
|
|
190
|
+
if (settled) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
settled = true;
|
|
194
|
+
clearTimeout(timer);
|
|
195
|
+
// Combined for the same reason `fetchStdoutExact`'s sibling calls
|
|
196
|
+
// treat stdout/stderr as one channel elsewhere in this backend: the
|
|
197
|
+
// outer script's own diagnostics (a PowerShell terminating error,
|
|
198
|
+
// say) could land on either.
|
|
199
|
+
resolveRun({ stdout: stderr.length > 0 ? `${stdout}\n${stderr}` : stdout });
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* The real, production `RestoreBrokerLauncher` — writes the outer script
|
|
205
|
+
* (see `buildOuterBrokerScript`) to a unique temp file, runs it via
|
|
206
|
+
* `powershell.exe -NoProfile -NonInteractive -File <script>`, and turns its
|
|
207
|
+
* parsed output (`parseBrokerScriptOutput`) into a `RestoreBrokerResult`:
|
|
208
|
+
*
|
|
209
|
+
* - WMI's own `ReturnValue` missing or non-zero (the process was never even
|
|
210
|
+
* created) throws — broker-infrastructure failure, per this function's own
|
|
211
|
+
* `RestoreBrokerLauncher` contract, for the caller to catch and fall back
|
|
212
|
+
* to a direct attempt.
|
|
213
|
+
* - `ecFile` never read back (`ecText === undefined`, or unparsable as an
|
|
214
|
+
* integer) resolves `{ kind: "unconfirmed" }` — see that type's own doc.
|
|
215
|
+
* - Otherwise resolves `{ kind: "completed", exitCode, output: outText ?? ""
|
|
216
|
+
* }` — the brokered restore's own result, for the caller to classify
|
|
217
|
+
* exactly like a direct attempt's.
|
|
218
|
+
*
|
|
219
|
+
* Every temp file (script, `outFile`, `ecFile`) is unique per call
|
|
220
|
+
* (`randomBytes`-suffixed, under `os.tmpdir()`) and best-effort removed in a
|
|
221
|
+
* `finally` — cleanup failures are swallowed, never allowed to mask the real
|
|
222
|
+
* outcome above.
|
|
223
|
+
*/
|
|
224
|
+
export const realRestoreBroker = async (msbPath, argv, timeoutMs) => {
|
|
225
|
+
const unique = `rightsize-restore-broker-${process.pid}-${randomBytes(6).toString("hex")}`;
|
|
226
|
+
const base = path.join(os.tmpdir(), unique);
|
|
227
|
+
const scriptFile = `${base}.ps1`;
|
|
228
|
+
const outFile = `${base}.out.txt`;
|
|
229
|
+
const ecFile = `${base}.ec.txt`;
|
|
230
|
+
const inner = buildInnerRestoreScript(msbPath, argv, outFile, ecFile);
|
|
231
|
+
const outer = buildOuterBrokerScript({ encodedInner: encodeAsEncodedCommand(inner), outFile, ecFile });
|
|
232
|
+
try {
|
|
233
|
+
try {
|
|
234
|
+
await fs.writeFile(scriptFile, outer, "utf8");
|
|
235
|
+
}
|
|
236
|
+
catch (err) {
|
|
237
|
+
throw new Error(`restore broker: failed to write its own script file '${scriptFile}': ${err instanceof Error ? err.message : String(err)}`);
|
|
238
|
+
}
|
|
239
|
+
const { stdout } = await runPowerShellFile(scriptFile, timeoutMs);
|
|
240
|
+
const parsed = parseBrokerScriptOutput(stdout);
|
|
241
|
+
if (parsed.returnValue === undefined) {
|
|
242
|
+
throw new Error(`restore broker: could not find a WMI ReturnValue in its own driver script's output:\n${stdout}`);
|
|
243
|
+
}
|
|
244
|
+
if (parsed.returnValue !== 0) {
|
|
245
|
+
throw new Error(`restore broker: WMI 'Win32_Process Create' refused to launch the restore (ReturnValue=${parsed.returnValue}):\n${stdout}`);
|
|
246
|
+
}
|
|
247
|
+
if (parsed.ecText === undefined) {
|
|
248
|
+
return { kind: "unconfirmed" };
|
|
249
|
+
}
|
|
250
|
+
const exitCode = Number.parseInt(parsed.ecText, 10);
|
|
251
|
+
if (!Number.isFinite(exitCode)) {
|
|
252
|
+
return { kind: "unconfirmed" };
|
|
253
|
+
}
|
|
254
|
+
return { kind: "completed", exitCode, output: parsed.outText ?? "" };
|
|
255
|
+
}
|
|
256
|
+
finally {
|
|
257
|
+
await Promise.all([
|
|
258
|
+
fs.rm(scriptFile, { force: true }).catch(() => { }),
|
|
259
|
+
fs.rm(outFile, { force: true }).catch(() => { }),
|
|
260
|
+
fs.rm(ecFile, { force: true }).catch(() => { }),
|
|
261
|
+
]);
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
//# sourceMappingURL=restore-broker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restore-broker.js","sourceRoot":"","sources":["../../src/backend-msb/restore-broker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAuF3C;;;;;;;;;GASG;AACH,MAAM,UAAU,4BAA4B,CAAC,KAAa;IACxD,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACnC,CAAC;AAED,wGAAwG;AACxG,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO,IAAI,4BAA4B,CAAC,KAAK,CAAC,GAAG,CAAC;AACpD,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAe,EAAE,IAAuB,EAAE,OAAe,EAAE,MAAc;IAC/G,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACnD,OAAO;QACL,KAAK,WAAW,CAAC,OAAO,CAAC,IAAI,UAAU,OAAO,WAAW,CAAC,OAAO,CAAC,EAAE;QACpE,4BAA4B,WAAW,CAAC,MAAM,CAAC,kCAAkC;KAClF,C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