ファイルのタイプの設定
ファイルのタイプは以下のファイルに記述されている。
/etc/selinux/targeted/
contexts/files/
file_contexts
file_contexts.homedirs
src/policy/file_contexts/*
file_contexts.homedirs一部抜粋:
/home/[^/]* -d user_u:object_r:user_home_dir_t
/home/[^/]*/.+ user_u:object_r:user_home_t
/home/tomita/htmlcontentsのファイルをhttpdからアクセスできるようにするには、以下の設定を追加して/home/tomita/htmlcontents以下のファイルのタイプがhttpd_user_content_tになるようにすればよい。
/home/tomita/htmlcontents(/.+)?
user_u:object_r:httpd_user_content_t
上記のファイルを修正した後、fixfilesコマンドにより設定を反映させることができる。
#/sbin/fixfiles relabel /home/apache
(/home/apache配下のみ再設定する場合)
関連
SELinux 基本編SELinux ポリシー設定編