@ai-ecoverse/slicc-kernel 1.145.0 → 1.146.0

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/dist/node.js CHANGED
@@ -3305,7 +3305,7 @@ function satisfies(version, range2) {
3305
3305
  }
3306
3306
 
3307
3307
  // src/version.ts
3308
- var KERNEL_VERSION = true ? "1.145.0" : "0.0.0-dev";
3308
+ var KERNEL_VERSION = true ? "1.146.0" : "0.0.0-dev";
3309
3309
  var OS_RELEASE = "6.0.0-slicc";
3310
3310
  function procVersion() {
3311
3311
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -26843,6 +26843,14 @@ function foreignImports(bytes) {
26843
26843
  }
26844
26844
  return {};
26845
26845
  }
26846
+ var LIBC_MARK = /^wasix-sysroot \d{4}\.\d+\.\d+-(\d+)/;
26847
+ function libcVersion(module) {
26848
+ for (const section of WebAssembly.Module.customSections(module, "slicc.libc")) {
26849
+ const found = LIBC_MARK.exec(new TextDecoder().decode(section));
26850
+ if (found) return Number(found[1]);
26851
+ }
26852
+ return void 0;
26853
+ }
26846
26854
 
26847
26855
  // src/refused-command.ts
26848
26856
  var REFUSED_PATH = "/usr/lib/slicc/refused";
@@ -27747,6 +27755,14 @@ function cronPath(path) {
27747
27755
  (at) => path === at || path.startsWith(`${at}/`) || at.startsWith(path === "/" ? "/" : `${path}/`)
27748
27756
  );
27749
27757
  }
27758
+ var ETC_HOSTNAME_LIBC = 42;
27759
+ function readsEtcHostname(program) {
27760
+ return program.abi === "wasi" && (libcVersion(program.module) ?? 0) >= ETC_HOSTNAME_LIBC;
27761
+ }
27762
+ function setOrDrop(env, key, value2) {
27763
+ if (value2 === void 0) delete env[key];
27764
+ else env[key] = value2;
27765
+ }
27750
27766
  function baseName2(path) {
27751
27767
  return path.slice(path.lastIndexOf("/") + 1);
27752
27768
  }
@@ -28909,6 +28925,7 @@ var Launcher = class {
28909
28925
  const env = { ...expandDefaults(asked.target.env, seen), ...req.env };
28910
28926
  for (const key of asked.target.unset ?? []) delete env[key];
28911
28927
  delete env[TICKET_ENV];
28928
+ const own = env.HOSTNAME;
28912
28929
  if (asked.target.abi === "wasi") env.HOSTNAME = this.hostname;
28913
28930
  const planned = chosen(asked, env);
28914
28931
  const { target, args } = planned;
@@ -28919,6 +28936,7 @@ var Launcher = class {
28919
28936
  const caller = { pid: req.ppid ?? 0, uid: req.cred.euid, tag: req.tags?.[0] };
28920
28937
  if (this.integrity) await this.checkedSources(planned, caller);
28921
28938
  [program, exeId] = await Promise.all([this.program(target, env, caller), this.exeId(target)]);
28939
+ if (readsEtcHostname(program)) setOrDrop(env, "HOSTNAME", own);
28922
28940
  } catch (err) {
28923
28941
  await req.fds.closeAll();
28924
28942
  throw err;