Skip to content

install: -Z gives new files and directories a different SELinux type than GNU #15091

Open

Description

@abendrothj

With -Z, GNU install gives new files and directories the default context from the SELinux policy, as mkdir -Z and cp -Z do (in uutils too). uutils install derives it from the parent directory's context instead, and turns any type containing tmp into user_home_t.

On Fedora with SELinux enforcing, as a normal user:

$ install -Z f /tmp/f; install -d -Z /tmp/d; ls -Zd /tmp/f /tmp/d

GNU coreutils 9.12: /tmp/f is user_tmp_t, /tmp/d is tmp_t. uutils main: both are user_home_t.

mkdir -Z and cp -Z in uutils already agree with GNU. Under a home directory all of them give user_home_t, which is probably why the GNU install-Z-selinux test passes.

Activity

  1. abendrothj commented on Oct 14, 2026

    @abendrothj
    ContributorAuthor

    Directories are fixed in #15333 and files in #15359. One case stays different: GNU 9.12 gives tmp_t for install -d -Z /tmp/d with an absolute name, but user_tmp_t with a relative name (cd /tmp; install -d -Z d), with mkdir -Z /tmp/d, and for files. uutils gives user_tmp_t in all of these and doesn't copy that one case.

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