Skip to content

install: -t without -D writes the file as the target when the target is not a directory #14996

Description

@abendrothj

Without -D, install -t X f should fail unless X is an existing directory. GNU does: install: failed to access 'X': Not a directory (or No such file or directory). With a single source, uutils instead installs f as X and exits 0:

echo old > regular; ln -s nowhere dangling; mkfifo fifo; echo new > f
install -t regular f     # regular now contains "new"
install -t dangling f    # the symlink is replaced by a regular file
install -t fifo f        # the fifo is replaced by a regular file
install -t missing f     # creates a file named "missing"

The same happens with --target-directory=X, and with -v (which prints removed 'regular'), -b (which backs up and then overwrites) and -C. With two or more sources the target is rejected as expected (target 'regular' is not a directory).

GNU fails in all of these cases and leaves the paths untouched. A mistyped -t silently overwrites a file, similar to #12926.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions