When creating a user with useradd -M, the selinux context on the user's mail spool is incorrect.
Issue
- When creating a user with
useradd -M, theselinuxcontext on the user's mail spool is incorrect. - Upon creating a user with
-Moption, the user's mail spool is getting created withSELinuxtype etc_t. - Here is complete terminal output:
[root@localhost ~]# rpm -qa | grep shadow-utils
shadow-utils-4.1.4.2-19.el6_6.1.x86_64
[root@localhost ~]# rpm -qa | grep selinux-policy
selinux-policy-3.7.19-279.el6_7.8.noarch
selinux-policy-targeted-3.7.19-279.el6_7.8.noarch
[root@localhost ~]# ls -lZ /var/spool/mail/
-rw-------. root mail system_u:object_r:mail_spool_t:s0 root
-rw-rw----. rpc mail unconfined_u:object_r:mail_spool_t:s0 rpc
-rw-rw----. suresh mail unconfined_u:object_r:mail_spool_t:s0 suresh
-rw-rw----. user mail unconfined_u:object_r:mail_spool_t:s0 user
[root@localhost ~]# useradd -M testuser
[root@localhost ~]# ls -lZ /var/spool/mail/
-rw-------. root mail system_u:object_r:mail_spool_t:s0 root
-rw-rw----. rpc mail unconfined_u:object_r:mail_spool_t:s0 rpc
-rw-rw----. suresh mail unconfined_u:object_r:mail_spool_t:s0 suresh
-rw-rw----. testuser mail system_u:object_r:etc_t:s0 testuser
-rw-rw----. user mail unconfined_u:object_r:mail_spool_t:s0 user
- The context should be
mail_spool_t
Environment
- Red Hat Enterprise Linux 6.7
- shadow-utils-4.1.4.2-19.el6_6.1.x86_64
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.