@ai-ecoverse/slicc-kernel 1.196.11 → 1.196.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 +1 -1
- package/dist/async-process.js +1 -1
- package/dist/cloudflare-sources.js +1 -1
- package/dist/cloudflare.js +35 -24
- package/dist/cloudflare.js.map +2 -2
- package/dist/kernel-worker.js +35 -24
- package/dist/kernel-worker.js.map +2 -2
- package/dist/node-process-worker.cjs +1 -1
- package/dist/node-process-worker.js +1 -1
- package/dist/node.js +35 -24
- package/dist/node.js.map +2 -2
- package/dist/process-worker.js +1 -1
- package/package.json +1 -1
package/dist/cloudflare.js
CHANGED
|
@@ -5235,7 +5235,7 @@ function satisfies(version, range2) {
|
|
|
5235
5235
|
}
|
|
5236
5236
|
|
|
5237
5237
|
// src/version.ts
|
|
5238
|
-
var KERNEL_VERSION = true ? "1.196.
|
|
5238
|
+
var KERNEL_VERSION = true ? "1.196.12" : "0.0.0-dev";
|
|
5239
5239
|
var OS_RELEASE = "6.0.0-slicc";
|
|
5240
5240
|
function procVersion() {
|
|
5241
5241
|
return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
|
|
@@ -18901,9 +18901,11 @@ function splitWords(text) {
|
|
|
18901
18901
|
if (word !== void 0) words3.push(word);
|
|
18902
18902
|
return words3;
|
|
18903
18903
|
}
|
|
18904
|
+
function shellQuote(word) {
|
|
18905
|
+
return PLAIN.test(word) ? word : `'${word.replaceAll("'", `'\\''`)}'`;
|
|
18906
|
+
}
|
|
18904
18907
|
function quoteWord(word) {
|
|
18905
|
-
|
|
18906
|
-
return PLAIN.test(text) ? text : `'${text.replaceAll("'", `'\\''`)}'`;
|
|
18908
|
+
return shellQuote(hasControl2(word) ? withoutControl(word) : word);
|
|
18907
18909
|
}
|
|
18908
18910
|
function addPart(word, part) {
|
|
18909
18911
|
const last = word.length - 1;
|
|
@@ -18940,14 +18942,14 @@ function splitPatterns(text) {
|
|
|
18940
18942
|
}
|
|
18941
18943
|
var literal = (pattern) => pattern.map((p) => p ?? "*").join("");
|
|
18942
18944
|
var isAny = (pattern) => pattern?.length === 1 && pattern[0] === null;
|
|
18943
|
-
function literalWord(word) {
|
|
18944
|
-
if (!word.includes("*")) return
|
|
18945
|
+
function literalWord(word, quote) {
|
|
18946
|
+
if (!word.includes("*")) return quote(word);
|
|
18945
18947
|
const bare = word.replaceAll("*", "");
|
|
18946
|
-
return bare === "" || PLAIN.test(bare) ? word.replaceAll("*", "\\*") :
|
|
18948
|
+
return bare === "" || PLAIN.test(bare) ? word.replaceAll("*", "\\*") : quote(word);
|
|
18947
18949
|
}
|
|
18948
|
-
function patternWord(pattern) {
|
|
18949
|
-
if (pattern.length === 1 && typeof pattern[0] === "string") return literalWord(pattern[0]);
|
|
18950
|
-
return pattern.map((p) => p === null ? "*" : literalWord(p)).join("");
|
|
18950
|
+
function patternWord(pattern, quote) {
|
|
18951
|
+
if (pattern.length === 1 && typeof pattern[0] === "string") return literalWord(pattern[0], quote);
|
|
18952
|
+
return pattern.map((p) => p === null ? "*" : literalWord(p, quote)).join("");
|
|
18951
18953
|
}
|
|
18952
18954
|
function globMatch(items, subjects, star, one) {
|
|
18953
18955
|
let i = 0;
|
|
@@ -18993,11 +18995,14 @@ function commandMatches(cmnd, argv) {
|
|
|
18993
18995
|
(i, j) => wordMatch(want2[i], args[j])
|
|
18994
18996
|
);
|
|
18995
18997
|
}
|
|
18996
|
-
function
|
|
18997
|
-
const path =
|
|
18998
|
+
function formatCommand(cmnd, quote) {
|
|
18999
|
+
const path = quote(cmnd.path);
|
|
18998
19000
|
if (cmnd.args === void 0) return path;
|
|
18999
19001
|
if (cmnd.args.length === 0) return `${path} ""`;
|
|
19000
|
-
return [path, ...cmnd.args.map(patternWord)].join(" ");
|
|
19002
|
+
return [path, ...cmnd.args.map((arg) => patternWord(arg, quote))].join(" ");
|
|
19003
|
+
}
|
|
19004
|
+
function commandText(cmnd) {
|
|
19005
|
+
return formatCommand(cmnd, quoteWord);
|
|
19001
19006
|
}
|
|
19002
19007
|
function validWho(who) {
|
|
19003
19008
|
if (who === "ALL") return true;
|
|
@@ -19188,25 +19193,31 @@ function directiveError(text) {
|
|
|
19188
19193
|
}
|
|
19189
19194
|
return void 0;
|
|
19190
19195
|
}
|
|
19191
|
-
function
|
|
19192
|
-
|
|
19196
|
+
function legacyApproval(line, file, rule2) {
|
|
19197
|
+
const { cmnd } = rule2;
|
|
19198
|
+
if (cmnd === "*" || !rule2.nopasswd || rule2.sha256 !== void 0) return rule2;
|
|
19193
19199
|
if (file !== `${SUDOERS_D}/${rule2.who}` || !NAME3.test(rule2.who) || !NAME3.test(rule2.target)) {
|
|
19194
|
-
return
|
|
19200
|
+
return rule2;
|
|
19195
19201
|
}
|
|
19196
|
-
const
|
|
19197
|
-
const
|
|
19198
|
-
const cwd = rule2.cwd === void 0 ? "" : `Cwd ${quoteWord(rule2.cwd)} `;
|
|
19202
|
+
const quote = rule2.stdin === void 0 ? shellQuote : quoteWord;
|
|
19203
|
+
const cwd = rule2.cwd === void 0 ? "" : `Cwd ${quote(rule2.cwd)} `;
|
|
19199
19204
|
const stdin = rule2.stdin === void 0 ? "" : "Stdin none ";
|
|
19200
|
-
|
|
19205
|
+
const prefix = `NOPASSWD ${rule2.who} (${rule2.target}) ${cwd}${stdin}Cmnd `;
|
|
19206
|
+
if (!line.startsWith(prefix)) return rule2;
|
|
19207
|
+
const words3 = line.slice(prefix.length).trimEnd();
|
|
19208
|
+
if (cmnd.args === void 0) {
|
|
19209
|
+
if (words3 !== quote(cmnd.path)) return rule2;
|
|
19210
|
+
return { ...rule2, cmnd: { ...cmnd, args: [] }, ...stdin ? {} : { sha256: {} } };
|
|
19211
|
+
}
|
|
19212
|
+
if (cmnd.args.some((arg) => arg.includes(null))) return rule2;
|
|
19213
|
+
const current = rule2.cwd !== void 0 && words3 === formatCommand(cmnd, quote);
|
|
19214
|
+
const earliest = !stdin && words3 === [cmnd.path, ...cmnd.args.map(literal)].map(quote).join(" ");
|
|
19215
|
+
return current || earliest ? { ...rule2, sha256: {} } : rule2;
|
|
19201
19216
|
}
|
|
19202
19217
|
function kernelLine(m, line, file) {
|
|
19203
19218
|
const rules = kernelRules(m);
|
|
19204
19219
|
if (typeof rules === "string") return { error: rules };
|
|
19205
|
-
return {
|
|
19206
|
-
rules: rules.map(
|
|
19207
|
-
(rule2) => recordedBare(line, file, rule2) && rule2.cmnd !== "*" ? { ...rule2, cmnd: { path: rule2.cmnd.path, args: [] } } : rule2
|
|
19208
|
-
)
|
|
19209
|
-
};
|
|
19220
|
+
return { rules: rules.map((rule2) => legacyApproval(line, file, rule2)) };
|
|
19210
19221
|
}
|
|
19211
19222
|
var DEFAULTS = /^Defaults(?=[:@>!\s]|$)/;
|
|
19212
19223
|
var DEFAULTS_ONLY = `Defaults aren't supported, except timestamp_timeout, timestamp_type and env_keep for everyone, a user or a %group: this line changes nothing`;
|