Skip to content

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

Description

@giusebar

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions