`install -D file /file` fails and loses the file when the destination's parent is /

Đang mở Phù hợp với người mới
#13,232 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
rust
Lĩnh vực
cli

Hướng nghiên cứu

Bắt đầu từ cách lệnh install xử lý tùy chọn -D và tái hiện vấn đề bằng install -D -m755 file /file. Xác minh rằng tệp nguồn vẫn còn khả dụng, /file được tạo và mode của nó là 0755, khớp với hành vi của GNU install.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

U - install

When the destination of install -D is a single-component absolute path (i.e. its parent directory is the filesystem root /), install fails with a chmod error and does not produce the destination file. GNU coreutils handles this correctly.

Steps to reproduce

ubuntu@resolute-racoon:~$ ls
folder file
ubuntu@resolute-racoon:~$ install -D -m755 file /file
install: No such file or directory
ubuntu@resolute-racoon:~$ ls
folder

the file disappears and is not to be found even in /file.

Environmnet

ubuntu 26.04
install (uutils coreutils) 0.8.0

Expected behavior

Per the GNU install(1) documentation for -D:

-D — create all leading components of DEST except the last, then copy SOURCE to DEST

For DEST = /file, the only leading component except the last is /, which already exists. install should simply copy file to /file and set mode 0755.

Ngôn ngữ chính
Rust
Star
24.1k
Fork
2k
Merge trung bình
1 ngày 4 giờ
Pull request đã merge (30 ngày)
371

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của uutils/coreutils

Tất cả issue của uutils/coreutils

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.