opencode-landstrip 0.17.42 → 0.18.0
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/index.ts +13 -2
- package/package.json +2 -2
package/index.ts
CHANGED
|
@@ -838,7 +838,7 @@ function buildWrappedCommand(
|
|
|
838
838
|
command: string,
|
|
839
839
|
trapPort: number | null,
|
|
840
840
|
): string {
|
|
841
|
-
const baseArgs = ['-p', policyPath, ...shellArgs(shell, command)];
|
|
841
|
+
const baseArgs = ['run', '-p', policyPath, '--', ...shellArgs(shell, command)];
|
|
842
842
|
const plain = [landstripBinaryPath(), ...baseArgs].map(shellQuote).join(' ');
|
|
843
843
|
if (trapPort === null) return plain;
|
|
844
844
|
|
|
@@ -851,7 +851,18 @@ function buildWrappedCommand(
|
|
|
851
851
|
// and fall back to an explicit bash invocation that always speaks /dev/tcp.
|
|
852
852
|
// If both fail (no bash, dead port, set -e in the outer shell) landstrip runs
|
|
853
853
|
// without --trap-fd so the toast-notify path still works.
|
|
854
|
-
const trapped = [
|
|
854
|
+
const trapped = [
|
|
855
|
+
landstripBinaryPath(),
|
|
856
|
+
'run',
|
|
857
|
+
'--trap-fd',
|
|
858
|
+
'3',
|
|
859
|
+
'-p',
|
|
860
|
+
policyPath,
|
|
861
|
+
'--',
|
|
862
|
+
...shellArgs(shell, command),
|
|
863
|
+
]
|
|
864
|
+
.map(shellQuote)
|
|
865
|
+
.join(' ');
|
|
855
866
|
const bashTrap = `bash -c ${shellQuote(`exec 3<>/dev/tcp/127.0.0.1/${trapPort} 2>/dev/null && exec "$@"`)} bash ${trapped}`;
|
|
856
867
|
return `{ exec 3<>/dev/tcp/127.0.0.1/${trapPort} ; } 2>/dev/null && ${trapped} || ${bashTrap} 2>/dev/null || ${plain}`;
|
|
857
868
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-landstrip",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Landlock-based sandboxing for opencode with landstrip",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"landlock",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"ci:test": "npm test"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@landstrip/landstrip": "^0.
|
|
51
|
+
"@landstrip/landstrip": "^0.18.0",
|
|
52
52
|
"@opentui/solid": ">=0.3.4",
|
|
53
53
|
"solid-js": "1.9.12"
|
|
54
54
|
},
|