Duplicate entries for '/export/home' appear in 'etc/selinux/targeted/contexts/files/file_contexts.homedirs' file, with associated errors in 'messages' log

Solution Verified - Updated -

Issue

When the HOME=/export/home directive is set in the /etc/default/useradd file, to define the default home directory location for new users, and /export/home exists on the filesystem, a run of the genhomedircon command results in duplicate SELinux context templates being created for /export/home in the /etc/selinux/targeted/contexts/files/file_contexts.homedirs file.

The existence of these duplicate entries lead to error messages as given below, to appear in the messages log file, on any process involving the use of the /etc/selinux/targeted/contexts/files/file_contexts.homedirs file.

Mar 20 16:20:57 localhost restorecon:
/etc/selinux/targeted/contexts/files/file_contexts: Multiple same
specifications for /export/home/[^/]*/.+. 
Mar 20 16:20:57 localhost restorecon:
/etc/selinux/targeted/contexts/files/file_contexts: Multiple same
specifications for /export/home/[^/]*/.virtinst(/.*)?. 
....

Mar 20 16:27:46 localhost lvm[20599]:
/etc/selinux/targeted/contexts/files/file_contexts: Multiple same
specifications for /export/home/[^/]*/.+. 
Mar 20 16:27:46 localhost lvm[20599]:
/etc/selinux/targeted/contexts/files/file_contexts: Multiple same
specifications for /export/home/[^/]*/.virtinst(/.*)?. 
....

Environment

  • Red Hat Enterprise Linux 5
  • policycoreutils-1.33.12-14.8.el5 or earlier

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.