bug(services/fs): deleting "/" removes the configured root directory
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 81/100
Hướng nghiên cứu
Bắt đầu tại core/services/fs/src/deleter.rs, ở FsDeleter::delete_once, và kiểm tra cách root_join phân giải / trước khi xóa khỏi hệ thống tệp. Tái hiện cả hai trường hợp trong issue: xóa không đệ quy trên các thư mục gốc trống và có nội dung, và xóa đệ quy sau khi ghi một tệp. Hoàn thành khi thao tác xóa thư mục gốc không đệ quy giữ nguyên thư mục gốc, còn thao tác xóa đệ quy xóa nội dung bên trong nhưng vẫn giữ thư mục gốc.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
In core/services/fs/src/deleter.rs, FsDeleter::delete_once resolves path via self.core.root_join(&path)? and removes the resulting path directly without checking whether it resolves to self.core.root:
op.delete("/")(non-recursive) on an empty root runstokio::fs::remove_dir(&self.core.root), removing the configured root directory itself from disk (and failing with a directory-not-empty error on a populated root instead of keeping non-recursive root deletion as a safe no-op).op.delete_with("/").recursive(true)(andop.remove_all("/")) runstokio::fs::remove_dir_all(&self.core.root), deleting the configured root directory itself rather than clearing its children.
Steps to Reproduce
let temp_dir = tempfile::tempdir().unwrap();
let root = temp_dir.path().join("root");
let op = Operator::new(Fs::default().root(root.to_str().unwrap())).unwrap();
op.delete("/").await.unwrap();
assert!(root.is_dir()); // fails: configured root directory was removed
let op = Operator::new(Fs::default().root(root.to_str().unwrap())).unwrap();
op.write("file.txt", "hello").await.unwrap();
op.delete_with("/").recursive(true).await.unwrap();
assert!(root.is_dir()); // fails: configured root directory was removed
Expected Behavior
Matching root-preservation semantics (see #9630):
- Non-recursive
delete("/")should be a safe no-op that preserves both empty and populated configured roots. - Recursive
delete_with("/").recursive(true)should clear all children inside the configured root (unlinking symlinks without touching external targets) while preserving the configured root directory itself.
AI Usage Statement
- Harness: Antigravity
- Model: Gemini 3.1 Pro
- Effort: High
- Role: Identified the missing root guard in
FsDeleter::delete_once, reproduced both non-recursive and recursive root deletion failures locally, and drafted this report.
- Ngôn ngữ chính
- Rust
- Star
- 5.5k
- Fork
- 869
- Merge trung bình
- 8 giờ 2 phút
- Pull request đã merge (30 ngày)
- 862
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/opendal
-
core enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
apache/opendal#9572 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(bindings/nodejs): reject negative and overflowing BigInt values in WriteOptions.chunk and Read/ReaderOptions.gapCó thể đã có người làm @rohan4naik đã nhận hôm nay. Đang mởbindings/nodejs bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
apache/opendal#9569 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug(layers/throttle): throttle streaming ReadStream bytes instead of pre-charging ReadOptions::limit upper bounds on open()Có thể đã có người làm @Xuanwo đã nhận hôm nay. Đang mởbug core
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
apache/opendal#9567 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bindings/c bindings/dotnet bindings/go bindings/java bindings/python bindings/ruby core integrations/object_store release release-blocker services/azblob services/azdls services/dropbox services/gcs_grpc services/git services/hf3fs services/redis services/remotestorage services/s3 website
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
apache/opendal#9560 · 3 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug services/dropbox services/gcs_grpc services/git services/hf3fs services/remotestorage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
apache/opendal#9553 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của apache/opendal
Issue tương tự
-
marketing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 87/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area/geometry good first issue help wanted kind/doc-mismatch severity/4-minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Apich-Organization/rssn#295 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
thisnick/agent-wechat#908 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Show install details by defaultĐang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
FortoGraphy/prism-download-manager#242 ·
Maintainer thường phản hồi trong vòng 1 ngày