install -Z returns an error "install: target '<target>' is not a directory

Solution Unverified - Updated -

Issue

  • The install commando returns an error when using the -Z option.
  • To reproduce the error use the following example:
# install -Z system_u:object_r:etc_t:s0 -m 444 -o root -g root /etc/passwd /tmp/tmpfile
  • This returns "install: target ‘/tmp/tmpfile’ is not a directory"
  • The same example with --context works as expected:
# install --context=system_u:object_r:etc_t:s0 -m 444 -o root -g root /etc/passwd /tmp/tmpfile
  • We use the install command with the long option --context, that works fine.

Environment

  • Red Hat Enterprise Linux 7
  • coreutils

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content