@ai-ecoverse/slicc-kernel 1.144.0 → 1.145.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.144.0" : "0.0.0-dev";
3308
+ var KERNEL_VERSION = true ? "1.145.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
@@ -4074,11 +4074,14 @@ function parseCrontab(text, path, system = false) {
4074
4074
  // src/cron/crontab.ts
4075
4075
  var CRONTAB_MAX = 256 * 1024;
4076
4076
  var TAGS_PATH = "/var/spool/cron/tags";
4077
+ var TAGS_VERSION = 1;
4077
4078
  async function readTags(fs) {
4078
4079
  const text = await fs.readFile(TAGS_PATH).catch(() => "");
4079
4080
  try {
4080
4081
  const parsed2 = JSON.parse(text);
4081
- return parsed2 && typeof parsed2 === "object" ? parsed2 : {};
4082
+ if (!parsed2 || typeof parsed2 !== "object") return {};
4083
+ const { v: _, ...tables } = parsed2;
4084
+ return tables;
4082
4085
  } catch {
4083
4086
  return {};
4084
4087
  }
@@ -4144,8 +4147,8 @@ var Crontabs = class {
4144
4147
  const kept = { ...all };
4145
4148
  if (Object.keys(table).length > 0) kept[path] = table;
4146
4149
  else delete kept[path];
4147
- const json5 = JSON.stringify(kept);
4148
- if (json5 === JSON.stringify(all)) return;
4150
+ const json5 = JSON.stringify({ v: TAGS_VERSION, ...kept });
4151
+ if (json5 === await fs.readFile(TAGS_PATH).catch(() => "")) return;
4149
4152
  const owner = owners ? { uid: 0, gid: 0, mode: 384 } : void 0;
4150
4153
  const fresh2 = `${TAGS_PATH}.${crypto.randomUUID()}.new`;
4151
4154
  await fs.writeFile(fresh2, json5, owner);
@@ -4332,11 +4335,26 @@ var UnlinkedKeeper = class {
4332
4335
  },
4333
4336
  async rename(from, to) {
4334
4337
  const target = fs.resolvePath("/", to);
4335
- if (target === fs.resolvePath("/", from)) return fs.rename(from, to);
4336
- await replace(target, async (gated, sealed) => {
4337
- const pinned = await keeper.pin(target, gated, sealed);
4338
- await keeper.settle(pinned, () => fs.rename(from, to));
4339
- });
4338
+ const source = fs.resolvePath("/", from);
4339
+ if (target === source) return fs.rename(from, to);
4340
+ keeper.touch(source);
4341
+ try {
4342
+ await replace(target, async (gated, sealed) => {
4343
+ const pinned = await keeper.pin(target, gated, sealed);
4344
+ await keeper.settle(pinned, () => fs.rename(from, to));
4345
+ });
4346
+ } finally {
4347
+ keeper.touch(source);
4348
+ }
4349
+ },
4350
+ async symlink(target, path, owner) {
4351
+ const at = fs.resolvePath("/", path);
4352
+ keeper.touch(at);
4353
+ try {
4354
+ await fs.symlink(target, path, owner);
4355
+ } finally {
4356
+ keeper.touch(at);
4357
+ }
4340
4358
  },
4341
4359
  readdir: async (path) => visible(await fs.readdir(path)),
4342
4360
  readdirStat: async (path) => (await fs.readdirStat(path)).filter(([name2]) => name2 !== UNLINKED_DIR).map(([name2, st]) => [name2, st && counted3(st)])
@@ -9744,6 +9762,9 @@ async function holdOp(entry, path, req) {
9744
9762
  await r?.settled(path);
9745
9763
  const gen = r?.generation() ?? 0;
9746
9764
  await opening(entry, path, mode);
9765
+ if (req.nofollow && (await entry.fs.lstat(path).catch(() => void 0))?.isSymbolicLink) {
9766
+ throw syncError("ELOOP", path);
9767
+ }
9747
9768
  const real = await entry.fs.realpath?.(path, true).catch(() => path);
9748
9769
  await entry.source?.open(path, real);
9749
9770
  await stillThere(entry, path, req);