cp -a exits 0 when an existing directory prevents it from copying a symlink
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue nà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
- 78/100
Hướng nghiên cứu
Bắt đầu từ src/uu/cp/src/copydir.rs, quanh các dòng được liên kết 294–341, sau đó theo dõi cách copy_direntry xử lý lỗi từ copy_file đối với liên kết tượng trưng khi bật tính năng giữ nguyên liên kết. Tái hiện bằng bộ kiểm thử shell trong issue và so sánh cp -RP với cp -a. Hoàn tất khi trường hợp cp -a báo lỗi sao chép và thoát với mã khác không, khớp với đầu ra mong đợi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
When updating a backup, cp -a silently skips a source symlink if its destination is an existing directory. A script can report a successful backup while the current path still serves old contents.
Reproduction
cd "$(mktemp -d)" || exit 1
export LC_ALL=C
mkdir -p src/v2 backup/src/current
printf 'new\n' > src/v2/version
printf 'old\n' > backup/src/current/version
ln -s v2 src/current
cp -a src backup
printf 'cp status: %s\n' "$?"
cat backup/src/current/version
Actual
uutils copies v2, leaves the old current directory in place, and prints no diagnostic.
cp status: 0
old
Expected
GNU coreutils 9.7 and 9.12 preserve the existing directory and report the failed copy.
cp: cannot overwrite directory 'backup/src/current' with non-directory 'src/current'
cp status: 1
old
Cause and tested versions
During recursive traversal, copy_file returns an error when symlink creation fails. With hard-link preservation enabled by -a, copy_direntry discards that error for a source symlink and returns Ok(false). On the same fixture, uutils cp -RP exits 1, while adding --preserve=links reproduces the silent success. Source
Reproduced on x86-64 Debian 13 with uutils release 0.13.0 (07b76df46339) and upstream main (2a072db2938e).
- Ngôn ngữ chính
- Rust
- Star
- 24.5k
- Fork
- 2.2k
- Merge trung bình
- 2 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 325
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
- Không 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 uutils/coreutils
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
dd: seek=010 silently writes at offset 8 instead of 10Có thể đã có người làm @adityawrk đã nhận 1 ngày trước. Đang mởU - dd
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
uutils/coreutils#16919 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
od: abbreviated --format is accepted but ignoredCó thể đã có người làm @yewjung đã nhận 1 ngày trước. Đang mởU - od
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
I - Documentation U - All (Tooling)
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 65/100
uutils/coreutils#16847 · 12 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Recursive cp overwrites files one directory too high on Linux when the source name ends in a literal backslash and dotCó thể đã có người làm @Xnadir đã nhận 6 ngày trước. Đang mởU - cp
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của uutils/coreutils
Issue tương tự
-
psmux-resurrect: restoring a session with a numeric name puts its windows into the wrong session (`new-window -t 4` is read as window 4)Có thể đã có người làm @ealwanlee đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
psmux/psmux-plugins#47 ·
-
Link Checker ReportĐang mởautomated issue report
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
ratatui/awesome-ratatui#598 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:core priority:high status:ready type:security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
release
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
github/gh-aw-mcpg#17603 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
C-Bug S-Needs-Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
bevyengine/bevy#26718 ·
Maintainer thường phản hồi trong vòng 2 ngày