2

I cannot add a file contexts to the running SELinux policy using semanage under Fedora 21. When executing the semanage fcontext --add command, I receive an OSError:

mf@vienna ~ % sudo semanage fcontext -a -t httpd_sys_rw_content_t "/var/lib/owncloud(/.*)?"
libsemanage.dbase_llist_query: could not query record value (No such file or directory).
OSError: No such file or directory

There are no additional log entries generated (no syslog nor audit logs).

I am using the targeted policy in version 3.13.1-105.9.

I thought about the possibility that the httpd_sys_rw_content_t type was renamed/removed in that policy, but I can set that type using chcon and also there exist already fcontexts using that type in the running policy (sudo semanage fcontext -l | grep httpd_sys_rw_content_t | wc -l returns 33).

1 Answer 1

0

I am not an selinux expert (by any stretch of the imagination) but I had a very similar issue to yours. I needed /var/www to be writeable to the httpd process in order for my scripts to work. Running:

semanage fcontext -a -t httpd_sys_rw_content_t '/var/www(/.*)?'

Resulted in this error:

libsemanage.dbase_llist_query: could not query record value (No such file or directory).
FileNotFoundError: [Errno 2] No such file or directory

To fix I ended up editing the /var/www(/.*)? entry in /etc/selinux/targeted/contexts/files then running restorecon.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .