@ai-ecoverse/slicc-kernel 1.102.0 → 1.102.1

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
@@ -7490,6 +7490,11 @@ function devRemoval(path, cred) {
7490
7490
  if (cred && cred.euid !== 0) return "EACCES";
7491
7491
  return path === "/dev" ? "EBUSY" : "EPERM";
7492
7492
  }
7493
+ function devCreation(path, cred) {
7494
+ if (path === "/proc" || path.startsWith("/proc/")) return "EROFS";
7495
+ if (path === "/dev" || !inDevTree(path)) return void 0;
7496
+ return cred && cred.euid !== 0 ? "EACCES" : "EPERM";
7497
+ }
7493
7498
 
7494
7499
  // src/fs/fresh-modules.ts
7495
7500
  var MAGIC = [0, 97, 115, 109];
@@ -10245,12 +10250,29 @@ async function guardAndResolve(entry, path, req) {
10245
10250
  };
10246
10251
  }
10247
10252
  var REMOVALS = /* @__PURE__ */ new Set(["unlink", "rmdir", "rm"]);
10253
+ var CREATIONS = /* @__PURE__ */ new Set(["write", "mkdir", "symlink", "create"]);
10254
+ var NAMING = /* @__PURE__ */ new Set(["link", "rename"]);
10255
+ async function newDevName(entry, path, req) {
10256
+ const named = NAMING.has(req.op);
10257
+ if (!named && !CREATIONS.has(req.op)) return void 0;
10258
+ const target = named ? entry.fs.resolvePath(entry.cwd, req.arg2 ?? "") : path;
10259
+ const refused2 = devCreation(target, entry.cred?.());
10260
+ if (!refused2) return void 0;
10261
+ const there = await entry.fs.lstat(target).then(
10262
+ () => true,
10263
+ () => false
10264
+ );
10265
+ if (there) return void 0;
10266
+ return { ok: false, errno: refused2, message: `${target}: no new names in /dev or /proc` };
10267
+ }
10248
10268
  async function dispatchOne(entry, req) {
10249
10269
  const { fs, cwd } = entry;
10250
10270
  try {
10251
10271
  const path = fs.resolvePath(cwd, req.path);
10252
10272
  const device = REMOVALS.has(req.op) ? devRemoval(path, entry.cred?.()) : void 0;
10253
10273
  if (device) return { ok: false, errno: device, message: `${path}: a device entry stays` };
10274
+ const made2 = await newDevName(entry, path, req);
10275
+ if (made2) return made2;
10254
10276
  const held = await byHandle(entry, path, req);
10255
10277
  if (held) return held;
10256
10278
  if (req.op === "access") return await accessOp(entry, path, req);
@@ -11107,7 +11129,7 @@ var PATH_OPS = new Set(SYNC_FS_OPS);
11107
11129
  var EARLY_WHOLE_FILE = 64 * 1024;
11108
11130
 
11109
11131
  // src/version.ts
11110
- var KERNEL_VERSION = true ? "1.102.0" : "0.0.0-dev";
11132
+ var KERNEL_VERSION = true ? "1.102.1" : "0.0.0-dev";
11111
11133
  var OS_RELEASE = "6.0.0-slicc";
11112
11134
  function procVersion() {
11113
11135
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC