Skip to content

Improve handle management - #1106

Merged
jaybosamiya-ms merged 5 commits into
mainfrom
jayb/handle-management
Jul 30, 2026
Merged

Improve handle management#1106
jaybosamiya-ms merged 5 commits into
mainfrom
jayb/handle-management

Conversation

@jaybosamiya-ms

Copy link
Copy Markdown
Member

This PR merges some operations to use a single Handle enum, rather than do them individually. This simplifies the Backend interface and also allows for supporting chmod of / (for example), which is needed as more backends move to the new design.

@jaybosamiya-ms
jaybosamiya-ms marked this pull request as ready for review July 29, 2026 20:52
@jaybosamiya-ms
jaybosamiya-ms enabled auto-merge July 29, 2026 20:52
@github-actions

Copy link
Copy Markdown

🤖 SemverChecks 🤖 ⚠️ Potential breaking API changes detected ⚠️

Click for details
--- failure trait_method_missing: pub trait method removed or renamed ---

Description:
A trait method is no longer callable, and may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-item-signature
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.49.0/src/lints/trait_method_missing.ron

Failed in:
  method file_status of trait Backend, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/cc47dfa84e80a9c212344bff43023afd2f14fe76/litebox/src/fs/backend.rs:130
  method dir_status of trait Backend, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/cc47dfa84e80a9c212344bff43023afd2f14fe76/litebox/src/fs/backend.rs:133
  method chmod_at of trait Backend, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/cc47dfa84e80a9c212344bff43023afd2f14fe76/litebox/src/fs/backend.rs:154
  method chown_at of trait Backend, previously in file /home/runner/work/litebox/litebox/target/semver-checks/git-main/cc47dfa84e80a9c212344bff43023afd2f14fe76/litebox/src/fs/backend.rs:157

@wdcui wdcui left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks. GPT-5.6 sol reported the following potential issue:

Medium —  litebox/src/fs/resolver.rs:211-217, 653-676 

 chmod / chown  now require execute permission on the target directory itself. An owner cannot restore  /locked  from mode  0600  to  0700 , although only the parent should require search permission. Exclude the final target directory from walk-permission checks for metadata operations.

The concern was:

• Previously,  chmod("/a/locked")  walked only  /a .
• Now  path_handle()  walks  /a/locked .
• For a directory,  check_walk_permissions()  checks execute permission on  locked  too.
• POSIX requires search permission on parent directories, not the final directory being changed.

@jaybosamiya-ms
jaybosamiya-ms added this pull request to the merge queue Jul 30, 2026
Merged via the queue into main with commit cc3925d Jul 30, 2026
14 checks passed
@jaybosamiya-ms
jaybosamiya-ms deleted the jayb/handle-management branch July 30, 2026 13:48
@jaybosamiya-ms

jaybosamiya-ms commented Jul 30, 2026

Copy link
Copy Markdown
Member Author

Hmm, this is a valid concern, will fix up in a separate PR

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.

2 participants