genhomedircon: require match for home directory name

Use regular expression '/[^/]+' instead of '/[^/]*', like semodule's
genhomedircon.
Generates file contexts like '/home/[^/]+/dead\.letter'

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
This commit is contained in:
Christian Göttsche 2021-01-31 21:50:18 +01:00
parent 577373f0db
commit 806a0d12f8

View File

@ -266,7 +266,7 @@ class selinuxConfig:
def genoutput(self):
ret= self.heading()
for h in self.getHomeDirs():
ret += self.getHomeDirContext ("user_u" , h+'/[^/]*', "user")
ret += self.getHomeDirContext ("user_u" , h+'/[^/]+', "user")
ret += self.getHomeRootContext(h)
ret += self.genHomeDirContext()
return ret