@ai-ecoverse/slicc-kernel 1.196.13 → 1.196.14

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/README.md CHANGED
@@ -1131,7 +1131,9 @@ interface ConnectorStamp { pid: number; ppid: number; uid: number; gid: number;
1131
1131
 
1132
1132
  A lookup follows at most 40 symlinks, as Linux does: the 41st is `ELOOP`, for WASI programs, JS programs and the kernel API alike, with or without `..` in a link's target. Emscripten programs resolve paths in their glue, which stops one link earlier, at 40.
1133
1133
 
1134
- Directories are renamed with `FileSystemHandle.move()` where available, else by copy and delete.
1134
+ OPFS renames use `FileSystemHandle.move()` when available. If a directory handle has no native move, the kernel coordinates with writers before copying the tree and deleting the source. Replacing an empty directory also uses this coordination. A shared-capable root without the locks needed for a copy returns `EBUSY` instead.
1135
+
1136
+ If the rename did not coordinate a copy and the native move is absent or unsupported, it returns `EBUSY` and leaves the source in place. This is not a transient file lock: retrying the same operation on the same backend still fails, even if no peer is active. #2125 tracks restoring a safe fallback on private roots. Other native failures report their own errno, such as `ENOENT` for a vanished source or `EACCES` for a denied move.
1135
1137
 
1136
1138
  **FIFOs** (`mkfifo`, #896):
1137
1139
  - **Creating one:** an Emscripten program's `mkfifo`/`mknod(S_IFIFO)` makes a FIFO node on the OPFS root (in `/tmp`, `/home` and the rest), owned by the caller, with mode `mode & ~umask`. `stat`, `ls -l` (`p`) and `test -p` show it as a FIFO, in Emscripten, WASI and JS programs. A WASIX program makes one through `slicc_fs.path_mkfifo` (see [File modes and the umask](#file-modes-and-the-umask); its libc uses it from wasix-sysroot -33), and `stat`s, `open`s, reads and writes one like any program. An existing name is `EEXIST`. tmpfs mounts (`/dev/shm`, a tmpfs `/tmp`) have FIFO nodes too, through the driver's `fifos` capability ([#907](https://github.com/ai-ecoverse/slicc-kernel/issues/907)). hostfs, `fsa` and media mounts have none, so `mkfifo` there is `EPERM`, and `EROFS` on a readonly path.
@@ -1388,7 +1390,7 @@ With `users: 'enforce'` the kernel checks every file call that reaches it agains
1388
1390
  - **The layout:** with `users: 'report'` or `'enforce'`, the kernel gives its own paths an owner and a mode when they have no owner record yet: on a fresh root, and once on a root from before owners. These are `/` `0755`, `/root` `0700`, `/home` `0755`, `/etc` `0755`, `/etc/passwd` and `/etc/group` `0644`, `/usr` and `/usr/local` `0755`, `/node_modules` (or the `modules` option) and the system `PNPM_HOME` `0755`, all root's. A path that has a record keeps it, so an admin's `chmod 711 /home` or `chown cone /node_modules` lasts across restarts; a mounted path is left to its mount, and a path below a symlinked directory is stamped where it really is. Only a root that records owners is stamped: the OPFS root with its sidecar, which the page and the Node entry (in memory) both use; a custom root file system without owner records is left as it is. The directory for files removed while open, `/.slicc-unlinked`, is made root's `0700`. `/tmp` is the exception: it is set to `1777` at every start, and the first time owners are on for a root from before owners (and at every start after that until it has listed `/tmp` and succeeded for every entry), what is in it without an owner of its own is removed (as a boot empties `/tmp` on Linux; a file that is open is kept, a symlinked `/tmp` is left alone, and one `console.warn` line says how many entries went), since it would otherwise be root's, and a program that made it for its user, such as pnpm's lock directories, would find it isn't its own. Emscripten programs see `/` at `0755`, `/dev` at `0755`, `null`, `zero`, `full`, `random`, `urandom` and `tty` at `0666`, and `/dev/shm` at `1777`. With `users: 'off'` nothing is stamped. Paths the embedder makes (bios's `/opt` and `/var/lib/slicc`) are the embedder's to set. `/etc/sudoers` and `/etc/sudoers.d` are written when missing (see [Sudo](#sudo)).
1389
1391
  - **Terminals:** a terminal from `openTerminal` belongs to its session's user, with group `tty` when `/etc/group` has one (the user's own group otherwise), mode `0620`; a pseudo-terminal's slave `/dev/pts/N` belongs to the uid and gid that opened `/dev/ptmx`, mode `0620`. Opening one by name (`/dev/ttyN`, `/dev/pts/N`, from every runtime) needs both `r` and `w`, so only its owner and root open it: the kernel's terminal descriptor always reads and writes, so the group's `w` bit (`write`, `wall` on Linux) does not let a group member open it. `/dev/tty` is the opener's own controlling terminal and is not checked, and descriptors a process inherited (across `sudo` or a `setresuid` too) keep working. Emscripten programs' `stat` of `/dev/ttyN` and `/dev/pts/N` shows the owner and mode. With `users: 'off'` terminals have no owner, as before.
1390
1392
  - **A client's `fs`:** checked as the client's user; a page's client (root) passes.
1391
- - **Removed files still open:** a process that holds a removed file may look it up (`stat`, `lstat`) under the hidden name the kernel gave it in `/.slicc-unlinked`, which is root's `0700`; every other process is refused there, so the kernel's own bookkeeping of held files raises no denials for their holders. If the kernel can't move a held file into `/.slicc-unlinked` (OPFS refuses the move and the copy twice), the removal fails with `EBUSY` and the file stays where it was, so the holder keeps reading it ([#1218](https://github.com/ai-ecoverse/slicc-kernel/issues/1218)). Files of the same removal already moved aside are moved back. If one of those moves back fails too, that file stays in `/.slicc-unlinked`: its holder still reads it, but its name is gone although the removal reported `EBUSY`. That's a double failure, and rare.
1393
+ - **Removed files still open:** a process that holds a removed file may look it up (`stat`, `lstat`) under the hidden name the kernel gave it in `/.slicc-unlinked`, which is root's `0700`; every other process is refused there, so the kernel's own bookkeeping of held files raises no denials for their holders. The kernel tries twice to rename a held file into `/.slicc-unlinked`. If both attempts fail and the file is still present, removal returns `EBUSY` and the holder can keep reading the original file. These are two rename attempts, not two copy attempts: if no native file move is available, neither attempt makes an uncoordinated copy, and retrying removal does not help while the file still needs to be kept aside (#2125) ([#1218](https://github.com/ai-ecoverse/slicc-kernel/issues/1218)). Files of the same removal already moved aside are moved back. If one of those moves back fails too, that file stays in `/.slicc-unlinked`: its holder still reads it, but its name is gone although the removal reported `EBUSY`. That's a double failure, and rare.
1392
1394
 
1393
1395
  `users: 'enforce'` is the default of `createKernel` and `createNodeKernel`; pass `'report'` to find what a program would be refused without refusing it, or `'off'` for kernels without owners. A `Launcher` made directly (see [What is in here](#what-is-in-here)) still defaults to `'off'`.
1394
1396
 
@@ -1535,7 +1535,7 @@ function createParentRefreshCount() {
1535
1535
  }
1536
1536
 
1537
1537
  // src/version.ts
1538
- var KERNEL_VERSION = true ? "1.196.13" : "0.0.0-dev";
1538
+ var KERNEL_VERSION = true ? "1.196.14" : "0.0.0-dev";
1539
1539
  var OS_RELEASE = "6.0.0-slicc";
1540
1540
  function procVersion() {
1541
1541
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC