@ai-ecoverse/slicc-kernel 1.196.31 → 1.196.32
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 +2 -1
- package/dist/async-process.js +1 -1
- package/dist/cloudflare-sources.js +1 -1
- package/dist/cloudflare.js +30 -11
- package/dist/cloudflare.js.map +3 -3
- package/dist/kernel-worker.js +30 -11
- package/dist/kernel-worker.js.map +3 -3
- package/dist/node-process-worker.cjs +1 -1
- package/dist/node-process-worker.js +1 -1
- package/dist/node.js +30 -11
- package/dist/node.js.map +3 -3
- package/dist/process-worker.js +1 -1
- package/package.json +1 -1
package/dist/cloudflare.js
CHANGED
|
@@ -5273,7 +5273,7 @@ function satisfies(version, range2) {
|
|
|
5273
5273
|
}
|
|
5274
5274
|
|
|
5275
5275
|
// src/version.ts
|
|
5276
|
-
var KERNEL_VERSION = true ? "1.196.
|
|
5276
|
+
var KERNEL_VERSION = true ? "1.196.32" : "0.0.0-dev";
|
|
5277
5277
|
var OS_RELEASE = "6.0.0-slicc";
|
|
5278
5278
|
function procVersion() {
|
|
5279
5279
|
return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
|
|
@@ -28479,13 +28479,27 @@ function words2(value2) {
|
|
|
28479
28479
|
}
|
|
28480
28480
|
return [...value2];
|
|
28481
28481
|
}
|
|
28482
|
-
|
|
28483
|
-
|
|
28484
|
-
|
|
28485
|
-
|
|
28486
|
-
|
|
28487
|
-
|
|
28488
|
-
|
|
28482
|
+
var SUDO_ENV_MAX = 4096;
|
|
28483
|
+
var SUDO_ENV_BYTES = 1024 * 1024;
|
|
28484
|
+
function sudoVariables(value2, term) {
|
|
28485
|
+
const input = typeof value2 === "object" && value2 !== null ? value2 : {};
|
|
28486
|
+
const env = /* @__PURE__ */ Object.create(null);
|
|
28487
|
+
let count3 = 0;
|
|
28488
|
+
let budget = SUDO_ENV_BYTES;
|
|
28489
|
+
const fits = (name2, text) => {
|
|
28490
|
+
if (++count3 > SUDO_ENV_MAX || name2.length + text.length + 2 > budget) return false;
|
|
28491
|
+
budget -= storedSize(name2) + storedSize(text) + 2;
|
|
28492
|
+
return budget >= 0;
|
|
28493
|
+
};
|
|
28494
|
+
for (const name2 in input) {
|
|
28495
|
+
if (!Object.hasOwn(input, name2)) continue;
|
|
28496
|
+
const entry = input[name2];
|
|
28497
|
+
if (!fits(name2, typeof entry === "string" ? entry : "")) return void 0;
|
|
28498
|
+
if (typeof entry === "string" && /^[^=\0]+$/.test(name2) && !entry.includes("\0"))
|
|
28499
|
+
env[name2] = entry;
|
|
28500
|
+
}
|
|
28501
|
+
if (term !== void 0 && env.TERM !== term && !fits("TERM", term)) return void 0;
|
|
28502
|
+
return env;
|
|
28489
28503
|
}
|
|
28490
28504
|
var ESCAPES = { " ": "\\t", "\n": "\\n", "\r": "\\r" };
|
|
28491
28505
|
function clipboardLine(text) {
|
|
@@ -30472,12 +30486,17 @@ var WasmProcess = class _WasmProcess {
|
|
|
30472
30486
|
async sudo(req, cancelled) {
|
|
30473
30487
|
const { sudo } = this.options;
|
|
30474
30488
|
if (!sudo) throw new KernelError("ENOSYS");
|
|
30489
|
+
const args = words2(req.args);
|
|
30490
|
+
const term = typeof req.term === "string" ? req.term : void 0;
|
|
30491
|
+
const submitted = sudoVariables(req.env, term);
|
|
30492
|
+
if (submitted === void 0)
|
|
30493
|
+
return { errno: "E2BIG", error: "sudo: the submitted environment is too large" };
|
|
30475
30494
|
const call = {
|
|
30476
30495
|
op: "proc-sudo",
|
|
30477
|
-
args
|
|
30496
|
+
args,
|
|
30478
30497
|
cwd: typeof req.cwd === "string" && req.cwd.startsWith("/") ? req.cwd : "/",
|
|
30479
|
-
...
|
|
30480
|
-
env:
|
|
30498
|
+
...term !== void 0 ? { term } : {},
|
|
30499
|
+
env: submitted
|
|
30481
30500
|
};
|
|
30482
30501
|
const answer2 = await sudo(
|
|
30483
30502
|
call,
|