@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/kernel-worker.js
CHANGED
|
@@ -10034,7 +10034,7 @@ function satisfies(version, range2) {
|
|
|
10034
10034
|
}
|
|
10035
10035
|
|
|
10036
10036
|
// src/version.ts
|
|
10037
|
-
var KERNEL_VERSION = true ? "1.196.
|
|
10037
|
+
var KERNEL_VERSION = true ? "1.196.32" : "0.0.0-dev";
|
|
10038
10038
|
var OS_RELEASE = "6.0.0-slicc";
|
|
10039
10039
|
function procVersion() {
|
|
10040
10040
|
return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
|
|
@@ -32334,13 +32334,27 @@ function words2(value2) {
|
|
|
32334
32334
|
}
|
|
32335
32335
|
return [...value2];
|
|
32336
32336
|
}
|
|
32337
|
-
|
|
32338
|
-
|
|
32339
|
-
|
|
32340
|
-
|
|
32341
|
-
|
|
32342
|
-
|
|
32343
|
-
|
|
32337
|
+
var SUDO_ENV_MAX = 4096;
|
|
32338
|
+
var SUDO_ENV_BYTES = 1024 * 1024;
|
|
32339
|
+
function sudoVariables(value2, term) {
|
|
32340
|
+
const input = typeof value2 === "object" && value2 !== null ? value2 : {};
|
|
32341
|
+
const env = /* @__PURE__ */ Object.create(null);
|
|
32342
|
+
let count3 = 0;
|
|
32343
|
+
let budget = SUDO_ENV_BYTES;
|
|
32344
|
+
const fits = (name2, text) => {
|
|
32345
|
+
if (++count3 > SUDO_ENV_MAX || name2.length + text.length + 2 > budget) return false;
|
|
32346
|
+
budget -= storedSize(name2) + storedSize(text) + 2;
|
|
32347
|
+
return budget >= 0;
|
|
32348
|
+
};
|
|
32349
|
+
for (const name2 in input) {
|
|
32350
|
+
if (!Object.hasOwn(input, name2)) continue;
|
|
32351
|
+
const entry = input[name2];
|
|
32352
|
+
if (!fits(name2, typeof entry === "string" ? entry : "")) return void 0;
|
|
32353
|
+
if (typeof entry === "string" && /^[^=\0]+$/.test(name2) && !entry.includes("\0"))
|
|
32354
|
+
env[name2] = entry;
|
|
32355
|
+
}
|
|
32356
|
+
if (term !== void 0 && env.TERM !== term && !fits("TERM", term)) return void 0;
|
|
32357
|
+
return env;
|
|
32344
32358
|
}
|
|
32345
32359
|
var ESCAPES = { " ": "\\t", "\n": "\\n", "\r": "\\r" };
|
|
32346
32360
|
function clipboardLine(text) {
|
|
@@ -34327,12 +34341,17 @@ var WasmProcess = class _WasmProcess {
|
|
|
34327
34341
|
async sudo(req, cancelled) {
|
|
34328
34342
|
const { sudo } = this.options;
|
|
34329
34343
|
if (!sudo) throw new KernelError("ENOSYS");
|
|
34344
|
+
const args = words2(req.args);
|
|
34345
|
+
const term = typeof req.term === "string" ? req.term : void 0;
|
|
34346
|
+
const submitted = sudoVariables(req.env, term);
|
|
34347
|
+
if (submitted === void 0)
|
|
34348
|
+
return { errno: "E2BIG", error: "sudo: the submitted environment is too large" };
|
|
34330
34349
|
const call = {
|
|
34331
34350
|
op: "proc-sudo",
|
|
34332
|
-
args
|
|
34351
|
+
args,
|
|
34333
34352
|
cwd: typeof req.cwd === "string" && req.cwd.startsWith("/") ? req.cwd : "/",
|
|
34334
|
-
...
|
|
34335
|
-
env:
|
|
34353
|
+
...term !== void 0 ? { term } : {},
|
|
34354
|
+
env: submitted
|
|
34336
34355
|
};
|
|
34337
34356
|
const answer2 = await sudo(
|
|
34338
34357
|
call,
|