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.
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
the file disappears and is not to be found even in /file.
Environmnet
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.