chiark / gitweb /
shared: create files even if the SELinux policy has no context for them
authorMichal Schmidt <mschmidt@redhat.com>
Thu, 6 Nov 2014 15:48:11 +0000 (16:48 +0100)
committerMichal Schmidt <mschmidt@redhat.com>
Thu, 6 Nov 2014 16:02:21 +0000 (17:02 +0100)
commit2d58aa4692e9fc47911bff5d064ba3e328c35369
treef1350652b6f29dc7aa293d2891eed7709e131f43
parent3f85ef0f05ffc51e19f86fb83a1c51e8e3cd6817
shared: create files even if the SELinux policy has no context for them

The SELinux policy defines no context for some files. E.g.:
  $ matchpathcon /run/lock/subsys /dev/mqueue
  /run/lock/subsys        <<none>>
  /dev/mqueue     <<none>>

We still need to be able to create them.
In this case selabel_lookup_raw() returns ENOENT. We should then skip
setfscreatecon(), but still return success.
It was broken since c34255bdb2 ("label: unify code to make directories,
symlinks").
src/shared/selinux-util.c