@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/kernel-worker.js
CHANGED
|
@@ -9554,7 +9554,7 @@ function satisfies(version, range2) {
|
|
|
9554
9554
|
}
|
|
9555
9555
|
|
|
9556
9556
|
// src/version.ts
|
|
9557
|
-
var KERNEL_VERSION = true ? "1.196.
|
|
9557
|
+
var KERNEL_VERSION = true ? "1.196.12" : "0.0.0-dev";
|
|
9558
9558
|
var OS_RELEASE = "6.0.0-slicc";
|
|
9559
9559
|
function procVersion() {
|
|
9560
9560
|
return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
|
|
@@ -22535,9 +22535,11 @@ function splitWords(text) {
|
|
|
22535
22535
|
if (word !== void 0) words3.push(word);
|
|
22536
22536
|
return words3;
|
|
22537
22537
|
}
|
|
22538
|
+
function shellQuote(word) {
|
|
22539
|
+
return PLAIN2.test(word) ? word : `'${word.replaceAll("'", `'\\''`)}'`;
|
|
22540
|
+
}
|
|
22538
22541
|
function quoteWord(word) {
|
|
22539
|
-
|
|
22540
|
-
return PLAIN2.test(text) ? text : `'${text.replaceAll("'", `'\\''`)}'`;
|
|
22542
|
+
return shellQuote(hasControl(word) ? withoutControl(word) : word);
|
|
22541
22543
|
}
|
|
22542
22544
|
function addPart(word, part) {
|
|
22543
22545
|
const last = word.length - 1;
|
|
@@ -22574,14 +22576,14 @@ function splitPatterns(text) {
|
|
|
22574
22576
|
}
|
|
22575
22577
|
var literal = (pattern) => pattern.map((p) => p ?? "*").join("");
|
|
22576
22578
|
var isAny = (pattern) => pattern?.length === 1 && pattern[0] === null;
|
|
22577
|
-
function literalWord(word) {
|
|
22578
|
-
if (!word.includes("*")) return
|
|
22579
|
+
function literalWord(word, quote) {
|
|
22580
|
+
if (!word.includes("*")) return quote(word);
|
|
22579
22581
|
const bare = word.replaceAll("*", "");
|
|
22580
|
-
return bare === "" || PLAIN2.test(bare) ? word.replaceAll("*", "\\*") :
|
|
22582
|
+
return bare === "" || PLAIN2.test(bare) ? word.replaceAll("*", "\\*") : quote(word);
|
|
22581
22583
|
}
|
|
22582
|
-
function patternWord(pattern) {
|
|
22583
|
-
if (pattern.length === 1 && typeof pattern[0] === "string") return literalWord(pattern[0]);
|
|
22584
|
-
return pattern.map((p) => p === null ? "*" : literalWord(p)).join("");
|
|
22584
|
+
function patternWord(pattern, quote) {
|
|
22585
|
+
if (pattern.length === 1 && typeof pattern[0] === "string") return literalWord(pattern[0], quote);
|
|
22586
|
+
return pattern.map((p) => p === null ? "*" : literalWord(p, quote)).join("");
|
|
22585
22587
|
}
|
|
22586
22588
|
function globMatch(items, subjects, star, one) {
|
|
22587
22589
|
let i = 0;
|
|
@@ -22627,11 +22629,14 @@ function commandMatches(cmnd, argv) {
|
|
|
22627
22629
|
(i, j) => wordMatch(want2[i], args[j])
|
|
22628
22630
|
);
|
|
22629
22631
|
}
|
|
22630
|
-
function
|
|
22631
|
-
const path =
|
|
22632
|
+
function formatCommand(cmnd, quote) {
|
|
22633
|
+
const path = quote(cmnd.path);
|
|
22632
22634
|
if (cmnd.args === void 0) return path;
|
|
22633
22635
|
if (cmnd.args.length === 0) return `${path} ""`;
|
|
22634
|
-
return [path, ...cmnd.args.map(patternWord)].join(" ");
|
|
22636
|
+
return [path, ...cmnd.args.map((arg) => patternWord(arg, quote))].join(" ");
|
|
22637
|
+
}
|
|
22638
|
+
function commandText(cmnd) {
|
|
22639
|
+
return formatCommand(cmnd, quoteWord);
|
|
22635
22640
|
}
|
|
22636
22641
|
function validWho(who) {
|
|
22637
22642
|
if (who === "ALL") return true;
|
|
@@ -22822,25 +22827,31 @@ function directiveError(text) {
|
|
|
22822
22827
|
}
|
|
22823
22828
|
return void 0;
|
|
22824
22829
|
}
|
|
22825
|
-
function
|
|
22826
|
-
|
|
22830
|
+
function legacyApproval(line, file, rule) {
|
|
22831
|
+
const { cmnd } = rule;
|
|
22832
|
+
if (cmnd === "*" || !rule.nopasswd || rule.sha256 !== void 0) return rule;
|
|
22827
22833
|
if (file !== `${SUDOERS_D}/${rule.who}` || !NAME4.test(rule.who) || !NAME4.test(rule.target)) {
|
|
22828
|
-
return
|
|
22834
|
+
return rule;
|
|
22829
22835
|
}
|
|
22830
|
-
const
|
|
22831
|
-
const
|
|
22832
|
-
const cwd = rule.cwd === void 0 ? "" : `Cwd ${quoteWord(rule.cwd)} `;
|
|
22836
|
+
const quote = rule.stdin === void 0 ? shellQuote : quoteWord;
|
|
22837
|
+
const cwd = rule.cwd === void 0 ? "" : `Cwd ${quote(rule.cwd)} `;
|
|
22833
22838
|
const stdin = rule.stdin === void 0 ? "" : "Stdin none ";
|
|
22834
|
-
|
|
22839
|
+
const prefix = `NOPASSWD ${rule.who} (${rule.target}) ${cwd}${stdin}Cmnd `;
|
|
22840
|
+
if (!line.startsWith(prefix)) return rule;
|
|
22841
|
+
const words3 = line.slice(prefix.length).trimEnd();
|
|
22842
|
+
if (cmnd.args === void 0) {
|
|
22843
|
+
if (words3 !== quote(cmnd.path)) return rule;
|
|
22844
|
+
return { ...rule, cmnd: { ...cmnd, args: [] }, ...stdin ? {} : { sha256: {} } };
|
|
22845
|
+
}
|
|
22846
|
+
if (cmnd.args.some((arg) => arg.includes(null))) return rule;
|
|
22847
|
+
const current = rule.cwd !== void 0 && words3 === formatCommand(cmnd, quote);
|
|
22848
|
+
const earliest = !stdin && words3 === [cmnd.path, ...cmnd.args.map(literal)].map(quote).join(" ");
|
|
22849
|
+
return current || earliest ? { ...rule, sha256: {} } : rule;
|
|
22835
22850
|
}
|
|
22836
22851
|
function kernelLine(m, line, file) {
|
|
22837
22852
|
const rules = kernelRules(m);
|
|
22838
22853
|
if (typeof rules === "string") return { error: rules };
|
|
22839
|
-
return {
|
|
22840
|
-
rules: rules.map(
|
|
22841
|
-
(rule) => recordedBare(line, file, rule) && rule.cmnd !== "*" ? { ...rule, cmnd: { path: rule.cmnd.path, args: [] } } : rule
|
|
22842
|
-
)
|
|
22843
|
-
};
|
|
22854
|
+
return { rules: rules.map((rule) => legacyApproval(line, file, rule)) };
|
|
22844
22855
|
}
|
|
22845
22856
|
var DEFAULTS = /^Defaults(?=[:@>!\s]|$)/;
|
|
22846
22857
|
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`;
|