@ai-ecoverse/slicc-kernel 1.195.0 → 1.195.2

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.
@@ -5109,7 +5109,7 @@ function satisfies(version, range2) {
5109
5109
  }
5110
5110
 
5111
5111
  // src/version.ts
5112
- var KERNEL_VERSION = true ? "1.195.0" : "0.0.0-dev";
5112
+ var KERNEL_VERSION = true ? "1.195.2" : "0.0.0-dev";
5113
5113
  var OS_RELEASE = "6.0.0-slicc";
5114
5114
  function procVersion() {
5115
5115
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -19410,6 +19410,7 @@ var Sudo = class {
19410
19410
  for (const file of new Set(files)) {
19411
19411
  if (await this.trusted(file)) continue;
19412
19412
  const real2 = await this.real(file);
19413
+ if (Object.hasOwn(found, real2)) continue;
19413
19414
  found[real2] = await fs.readFileBuffer(real2).then(sha2562, () => "");
19414
19415
  }
19415
19416
  return found;
@@ -36797,7 +36798,7 @@ var Launcher = class {
36797
36798
  const ids = { pid: req.exec ? caller : pid, ppid: caller };
36798
36799
  const stamp = await this.sealed.stamp(ids, cred, this.tagsOf(ppid));
36799
36800
  const interpreters = await this.interpreterChain(planned, booked.cwd, scope);
36800
- const trusted = this.usersMode === "enforce" && await this.trustedFiles(planned, req.file, booked.cwd, scope);
36801
+ const trusted = this.usersMode === "enforce" && await this.trustedFiles(planned, req.file, booked.cwd);
36801
36802
  const swap = await this.sealed.consume({
36802
36803
  ticket: ticket2,
36803
36804
  stamp,
@@ -36818,7 +36819,7 @@ var Launcher = class {
36818
36819
  }
36819
36820
  const scrub = scrubberOf(secrets);
36820
36821
  const recheck = async (next3) => {
36821
- const same2 = sameList(planFiles(next3), planFiles(planned)) && sameList(await this.interpreterChain(next3, booked.cwd, scope), interpreters) && (this.usersMode === "enforce" && await this.trustedFiles(next3, req.file, booked.cwd, scope)) === trusted;
36822
+ const same2 = sameList(planFiles(next3), planFiles(planned)) && sameList(await this.interpreterChain(next3, booked.cwd, scope), interpreters) && (this.usersMode === "enforce" && await this.trustedFiles(next3, req.file, booked.cwd)) === trusted;
36822
36823
  if (!same2) throw new SpawnError("EACCES");
36823
36824
  };
36824
36825
  return { env, pid, cwd: booked.cwd, ...scrub ? { scrub } : {}, recheck };
@@ -36843,8 +36844,9 @@ var Launcher = class {
36843
36844
  if (!scoped || system?.glue === scoped.glue) return `/usr/bin/${name2}`;
36844
36845
  return scoped.glue;
36845
36846
  }
36846
- async trustedFiles(planned, file, cwd, scope) {
36847
- const files = await this.backingOf(planned, file, cwd, scope);
36847
+ async trustedFiles(planned, file, cwd) {
36848
+ const files = await this.backingOf(planned, file, cwd);
36849
+ files.push(...(planned.target.variants ?? []).map((variant) => variant.wasm));
36848
36850
  for (const at of files) {
36849
36851
  if (!await rootOnly(this.base, await physicalPathAsync(this.base, at))) return false;
36850
36852
  }
@@ -36853,7 +36855,7 @@ var Launcher = class {
36853
36855
  async unchanged(planned, file, cwd, grant) {
36854
36856
  const approved = grant?.files;
36855
36857
  if (!approved) return {};
36856
- const files = await this.backingOf(planned, file, cwd, "");
36858
+ const files = await this.backingOf(planned, file, cwd);
36857
36859
  refuseChanged(approved, await this.sudoer.digests([file, ...files]));
36858
36860
  return { pinned: approved };
36859
36861
  }
@@ -36886,18 +36888,18 @@ var Launcher = class {
36886
36888
  async backing(asked, cwd) {
36887
36889
  const file = await this.execFile(asked, cwd);
36888
36890
  const { planned } = await this.plan(file, [file], cwd, "");
36889
- return planned && this.backingOf(planned, file, cwd, "");
36891
+ return planned && this.backingOf(planned, file, cwd);
36890
36892
  }
36891
- async backingOf(planned, file, cwd, scope) {
36892
- const { glue, wasm, imports } = planned.target;
36893
+ async backingOf(planned, file, cwd) {
36894
+ const { glue, wasm, imports, copy } = planned.target;
36893
36895
  const files = [glue, wasm, ...imports ? [imports] : []];
36894
- const scripts = [];
36895
- for (const name2 of [file, ...planned.via ?? []]) {
36896
- if (name2.includes("/") && !COMMAND2.test(name2)) scripts.push(this.fs.resolvePath(cwd, name2));
36897
- const script = (await this.scriptCommand(name2, cwd, scope))?.script;
36898
- if (script) scripts.push(script);
36896
+ const sources = planned.sources ?? [];
36897
+ for (const [i, name2] of [file, ...planned.via ?? []].entries()) {
36898
+ if (name2.includes("/") && !COMMAND2.test(name2)) files.push(this.fs.resolvePath(cwd, name2));
36899
+ const source = sources[i];
36900
+ if (source !== void 0) files.push(source);
36899
36901
  }
36900
- files.push(...scripts, ...planned.binfmts ?? []);
36902
+ files.push(...copy ? [copy] : [], ...planned.binfmts ?? []);
36901
36903
  const roots = await this.roots();
36902
36904
  for (const at of [...files]) {
36903
36905
  const root = packageRootOf(at, roots) ?? PACKAGE_ROOT.exec(at)?.[1];