@ai-ecoverse/slicc-kernel 1.167.3 → 1.167.4

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.
@@ -7511,7 +7511,7 @@ var init_version = __esm({
7511
7511
  "src/version.ts"() {
7512
7512
  "use strict";
7513
7513
  init_captured_globals();
7514
- KERNEL_VERSION = true ? "1.167.3" : "0.0.0-dev";
7514
+ KERNEL_VERSION = true ? "1.167.4" : "0.0.0-dev";
7515
7515
  OS_RELEASE = "6.0.0-slicc";
7516
7516
  }
7517
7517
  });
@@ -7510,7 +7510,7 @@ var init_version = __esm({
7510
7510
  "src/version.ts"() {
7511
7511
  "use strict";
7512
7512
  init_captured_globals();
7513
- KERNEL_VERSION = true ? "1.167.3" : "0.0.0-dev";
7513
+ KERNEL_VERSION = true ? "1.167.4" : "0.0.0-dev";
7514
7514
  OS_RELEASE = "6.0.0-slicc";
7515
7515
  }
7516
7516
  });
package/dist/node.js CHANGED
@@ -800,28 +800,39 @@ async function stickyEntry(g, op, path, dir) {
800
800
  if (sticky(g.cred, perm, (await ancestryOf(g.fs, entry)).at(-1))) return;
801
801
  if (await present(g.fs, entry, false)) deny(g, op, path, "EPERM");
802
802
  }
803
+ async function unwritable(g, op, path, dir) {
804
+ if (dir.denied === void 0) return false;
805
+ if (dir.link) {
806
+ deny(g, op, dir.denied);
807
+ return false;
808
+ }
809
+ const perm = dir.denied === dir.path ? dir.perm : void 0;
810
+ if (perm && !await present(g.fs, dir.path, true)) return false;
811
+ if (perm && permits(g.cred, perm, X_OK)) return true;
812
+ deny(g, op, path);
813
+ return false;
814
+ }
803
815
  async function inParent(g, op, path, old = false) {
804
816
  await fence(g, op, path);
805
- if (old === "replaced") {
806
- const dir2 = await need(g, op, parentOf(path), W_OK | X_OK, DIR, path);
807
- return dir2.denied === void 0 ? stickyEntry(g, op, path, dir2) : void 0;
808
- }
809
- if (!old) return void await need(g, op, parentOf(path), W_OK | X_OK, DIR, path);
810
817
  const dir = await access(g.fs, g.cred, parentOf(path), W_OK | X_OK, linked(g, DIR));
818
+ if (old !== true) {
819
+ if (await unwritable(g, op, path, dir)) deny(g, op, path);
820
+ else if (old === "replaced" && dir.denied === void 0) await stickyEntry(g, op, path, dir);
821
+ return;
822
+ }
811
823
  if (dir.denied === void 0) return stickyEntry(g, op, path, dir);
812
824
  if (dir.link) return deny(g, op, dir.denied);
813
825
  const lookup4 = dir.denied === dir.path && dir.perm && permits(g.cred, dir.perm, X_OK);
814
826
  if (!lookup4 || await present(g.fs, entryIn(dir, path), false)) deny(g, op, path);
815
827
  }
816
- async function makeIn(g, op, path) {
828
+ async function makeIn(g, op, path, parents = true) {
817
829
  for (let dir = parentOf(path); ; dir = parentOf(dir)) {
818
830
  const walked = await access(g.fs, g.cred, dir, W_OK | X_OK, linked(g, DIR));
819
- if (walked.link) return deny(g, op, walked.denied);
820
- if (walked.denied !== void 0) {
831
+ if (await unwritable(g, op, path, walked)) {
821
832
  if (!await present(g.fs, path, true)) deny(g, op, path);
822
833
  return;
823
834
  }
824
- if (!walked.missing || dir === "/") return;
835
+ if (!parents || !walked.missing || dir === "/") return;
825
836
  }
826
837
  }
827
838
  async function tree(g, op, dir, perm) {
@@ -3684,7 +3695,7 @@ function satisfies(version, range2) {
3684
3695
  }
3685
3696
 
3686
3697
  // src/version.ts
3687
- var KERNEL_VERSION = true ? "1.167.3" : "0.0.0-dev";
3698
+ var KERNEL_VERSION = true ? "1.167.4" : "0.0.0-dev";
3688
3699
  var OS_RELEASE = "6.0.0-slicc";
3689
3700
  function procVersion() {
3690
3701
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -10956,7 +10967,7 @@ async function guard(g, path, req, cwd) {
10956
10967
  return { path: w };
10957
10968
  }
10958
10969
  case "mkdir": {
10959
- await makeIn(g, op, path);
10970
+ await makeIn(g, op, path, !req.exclusive);
10960
10971
  return { path: await walkSafe(g, path, false) };
10961
10972
  }
10962
10973
  case "create":
@@ -26953,6 +26964,10 @@ var OpfsFs = class {
26953
26964
  const children3 = /* @__PURE__ */ new Map();
26954
26965
  this.others++;
26955
26966
  for await (const child of handle.values()) children3.set(child.name, child);
26967
+ if (this.absent.size > 0) {
26968
+ const base = found.path === "/" ? "" : found.path;
26969
+ for (const name2 of children3.keys()) this.absent.delete(`${base}/${name2}`);
26970
+ }
26956
26971
  for (const link2 of await this.meta.links(found.path)) {
26957
26972
  const name2 = baseOf3(link2.path);
26958
26973
  if (!children3.has(name2)) children3.set(name2, link2);