Confined user mapped to SELinux sysadm_u, cannot run newaliases even after sudo'ing

Solution Verified - Updated -

Issue

  • When a user is running as SELinux role sysadm_r, it's not possible to update /etc/aliases.db by running newaliases.

    $ id -Z 
    staff_u:staff_r:staff_t:s0-s0:c0.c1023
    $ sudo id -Z
    staff_u:sysadm_r:sysadm_t:s0-s0:c0.c1023
    $ sudo newaliases
    postalias: fatal: open /etc/aliases.db: Permission denied
    

Environment

  • Red Hat Enterprise Linux 7 and later
  • confined user mapped to sysadm_u or transitioning to sysadm_r
  • newaliases
  • SELinux
  • /etc/sudoers

        %wheel ALL=(ALL) TYPE=sysadm_t ROLE=sysadm_r ALL
    

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