Skip to content

fs: implement rename, symlinks, *_at methods, and path tracking for in_mem/tar_ro#748

Draft
wdcui wants to merge 2 commits intowdcui/stacked/pr7-devicesfrom
wdcui/stacked/pr8-fs-implementations
Draft

fs: implement rename, symlinks, *_at methods, and path tracking for in_mem/tar_ro#748
wdcui wants to merge 2 commits intowdcui/stacked/pr7-devicesfrom
wdcui/stacked/pr8-fs-implementations

Conversation

@wdcui
Copy link
Copy Markdown
Member

@wdcui wdcui commented Apr 4, 2026

Summary

  • in_mem.rs: Adds rename (with POSIX directory-into-descendant EINVAL check), symlink/link/read_link support, create_anonymous_file (memfd), path tracking on descriptors, all *_at methods (open_at, stat_at, unlink_at, readlink_at, rename_at, mkdir_at, fd_path), O_PATH flag handling, root UID 0 permission bypass (CAP_DAC_OVERRIDE), just_created flag to skip permission checks for file creators, root dir ownership changed to 1000:1000 for single-user sandbox model
  • tar_ro.rs: Adds path tracking on descriptors, all *_at methods, O_PATH flag handling, rename/mkdir_at stubs returning ReadOnlyFileSystem
  • errors.rs: New RenameError variants (IsADirectory, NotADirectory, NotEmpty, InvalidArgument, CrossDevice, SameFile, ClosedFd, ReadOnlyFileSystem), new ReadLinkError/SymlinkError/LinkError variants, error message corrections
  • mod.rs: DirFdError enum for *_at helpers, memfd_display_path function; PTY trait methods deferred to layered.rs PR
  • devices.rs: RenameError::NotSupported → RenameError::Io (variant removed in errors.rs)

Stack

  • PR 7: wdcui/stacked/pr7-devicesbase
  • PR 8: this PR
  • PR 9: fs/layered.rs (next)

Testing

  • Build: clean
  • Clippy: clean
  • Fmt: clean
  • Tests: 208 passed, 15 failed (all pre-existing TUN/EPERM), 34 skipped
  • Doc: clean

… bypass for in_mem and tar_ro

Add concrete implementations to the in-memory and read-only tar filesystems:

- in_mem: rename with POSIX directory-into-descendant check, symlink/link/
  read_link support, create_anonymous_file (memfd), path tracking on
  descriptors, descriptor-relative *_at methods, O_PATH flag handling,
  root UID 0 permission bypass (CAP_DAC_OVERRIDE), just_created flag to
  skip permission checks for file creators, root dir ownership changed to
  1000:1000 for single-user sandbox model

- tar_ro: path tracking on descriptors, descriptor-relative *_at methods,
  O_PATH flag handling, rename/mkdir_at stubs returning ReadOnlyFileSystem

- errors: new RenameError variants (IsADirectory, NotADirectory, NotEmpty,
  InvalidArgument, CrossDevice, SameFile, ClosedFd, NotADirectory,
  ReadOnlyFileSystem), new ReadLinkError/SymlinkError/LinkError variants,
  FileStatusError reordering, error message corrections

- mod.rs: DirFdError enum for *_at helpers, memfd_display_path function,
  comment updates; PTY trait methods deferred to layered.rs PR

- devices.rs: RenameError::NotSupported replaced with RenameError::Io
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant