Bug 247117 - selinux module changes take ages and give genhomedircon errors
selinux module changes take ages and give genhomedircon errors
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: policycoreutils (Show other bugs)
7
All Linux
low Severity low
: ---
: ---
Assigned To: Daniel Walsh
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-07-05 10:47 EDT by Michael Young
Modified: 2008-01-21 10:42 EST (History)
0 users

See Also:
Fixed In Version: Current
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-01-21 10:42:50 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Suggested patch for genhomedircon (338 bytes, patch)
2007-07-05 10:47 EDT, Michael Young
no flags Details | Diff

  None (edit)
Description Michael Young 2007-07-05 10:47:49 EDT
Whenever I use semodule to add or remove a module or update some selinux
packages I get a lot of errors like
*username* homedir /home/*servername*/misc/*username* or its parent directory
conflicts with a
defined context in /etc/selinux/targeted/contexts/files/file_contexts,
/usr/sbin/genhomedircon will not create a new context. This usually indicates an
incorrectly defined system account.  If it is a system account please make sure
its login shell is /sbin/nologin.

We have a lot of home directories of the form /home/server/misc/user and it
seems that the problem is that genhomedircon is comparing each with the /misc
line in /etc/selinux/targeted/contexts/files/file_contexts and deciding they
match and thus produces an error. I believe the problem is that in the 
checkExists subroutine of genhomedircon the line
if re.search(regex,home, 0):
causes a match if regex fits any substring of "home". I believe you actually want
if re.match(regex,home):
so that it matches from the beginning of the string.

I have seen this with a number of versions of policycoreutils, including the
current one: policycoreutils-2.0.16-6.fc7
Comment 1 Michael Young 2007-07-05 10:47:49 EDT
Created attachment 158595 [details]
Suggested patch for genhomedircon
Comment 2 Daniel Walsh 2007-07-06 10:24:20 EDT
Fixed in policycoreutils-2.0.22-4.fc8

Note You need to log in before you can comment on or make changes to this bug.