@jeffusion/bungee 5.1.2 → 5.1.4
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/dist/index.js +25 -4
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -2773,8 +2773,26 @@ async function secureTarget(targetPath, options, mustExist) {
|
|
|
2773
2773
|
fail2("race", "metadata file was detached by rename");
|
|
2774
2774
|
if (platform !== "win32" && typeof process.geteuid === "function" && item.uid !== process.geteuid())
|
|
2775
2775
|
fail2("owner", "metadata owner is invalid");
|
|
2776
|
-
if (platform === "win32")
|
|
2777
|
-
|
|
2776
|
+
if (platform === "win32") {
|
|
2777
|
+
try {
|
|
2778
|
+
await ensureWindowsAcl(target, options.windowsAcl ?? defaultWindowsAclAdapter(), "file", options);
|
|
2779
|
+
} catch (error) {
|
|
2780
|
+
if (error instanceof DaemonFileError && error.code === "acl") {
|
|
2781
|
+
let current;
|
|
2782
|
+
try {
|
|
2783
|
+
current = await lstat(target);
|
|
2784
|
+
} catch (inspectionError) {
|
|
2785
|
+
if (inspectionError.code === "ENOENT")
|
|
2786
|
+
throw inspectionError;
|
|
2787
|
+
throw error;
|
|
2788
|
+
}
|
|
2789
|
+
if (!sameIdentity(identity(item), identity(current))) {
|
|
2790
|
+
fail2("race", "metadata file changed during Windows ACL inspection", error);
|
|
2791
|
+
}
|
|
2792
|
+
}
|
|
2793
|
+
throw error;
|
|
2794
|
+
}
|
|
2795
|
+
}
|
|
2778
2796
|
testStage(options, "target_realpath");
|
|
2779
2797
|
const canonical = await realpath(target);
|
|
2780
2798
|
if (!contained(canonicalRoot, canonical, platform)) {
|
|
@@ -3006,7 +3024,9 @@ function formatDaemonFileAclError(error) {
|
|
|
3006
3024
|
const operation = WINDOWS_ACL_OPERATIONS.has(diagnostic.operation) ? diagnostic.operation : "unknown";
|
|
3007
3025
|
const outcome = WINDOWS_ACL_OUTCOMES.has(diagnostic.outcome) ? diagnostic.outcome : "unknown";
|
|
3008
3026
|
const lastPhase = diagnostic.last_phase === null ? "null" : WINDOWS_ACL_PHASES.has(diagnostic.last_phase) ? diagnostic.last_phase : "unknown";
|
|
3009
|
-
|
|
3027
|
+
const targetKind = diagnostic.target_kind !== null && WINDOWS_ACL_TARGET_KINDS.has(diagnostic.target_kind) ? diagnostic.target_kind : "unknown";
|
|
3028
|
+
const exitCode = diagnostic.exit_code === null ? "null" : Number.isSafeInteger(diagnostic.exit_code) && Math.abs(diagnostic.exit_code) <= 2147483647 ? diagnostic.exit_code : "unknown";
|
|
3029
|
+
return `acl_operation=${operation} outcome=${outcome}` + ` last_phase=${lastPhase} kill_returned_true=${diagnostic.kill_returned_true === true}` + ` spawn_event=${diagnostic.spawn_event === true} exit_event=${diagnostic.exit_event === true}` + ` close_event=${diagnostic.close_event === true}` + ` target_kind=${targetKind} exit_code=${exitCode}`;
|
|
3010
3030
|
}
|
|
3011
3031
|
function boundedElapsed(startedAt, deadlineMs) {
|
|
3012
3032
|
return Math.min(deadlineMs, Math.max(0, Date.now() - startedAt));
|
|
@@ -3029,6 +3049,7 @@ function processDiagnostic(operation, startedAt, phase, environment, deadlineMs,
|
|
|
3029
3049
|
outcome: result.outcome,
|
|
3030
3050
|
elapsed_ms: boundedElapsed(startedAt, deadlineMs),
|
|
3031
3051
|
exit_code: typeof result.exitCode === "number" ? result.exitCode : null,
|
|
3052
|
+
target_kind: environment.BUNGEE_DAEMON_ACL_KIND === "directory" || environment.BUNGEE_DAEMON_ACL_KIND === "file" ? environment.BUNGEE_DAEMON_ACL_KIND : null,
|
|
3032
3053
|
signal: allowedSignal(result.signal ?? null),
|
|
3033
3054
|
spawn_event: result.spawnEvent,
|
|
3034
3055
|
exit_event: result.exitEvent,
|
|
@@ -3368,7 +3389,7 @@ import { createInterface } from "node:readline";
|
|
|
3368
3389
|
// package.json
|
|
3369
3390
|
var package_default = {
|
|
3370
3391
|
name: "@jeffusion/bungee",
|
|
3371
|
-
version: "5.1.
|
|
3392
|
+
version: "5.1.4",
|
|
3372
3393
|
description: "High-performance reverse proxy server CLI",
|
|
3373
3394
|
type: "module",
|
|
3374
3395
|
bin: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jeffusion/bungee",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.4",
|
|
4
4
|
"description": "High-performance reverse proxy server CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"test": "bun test"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@jeffusion/bungee-core": "^5.1.
|
|
17
|
-
"@jeffusion/bungee-types": "^5.1.
|
|
16
|
+
"@jeffusion/bungee-core": "^5.1.4",
|
|
17
|
+
"@jeffusion/bungee-types": "^5.1.4",
|
|
18
18
|
"cli-progress": "^3.12.0",
|
|
19
19
|
"commander": "^14.0.1"
|
|
20
20
|
},
|