03 12月 2008

SELinux 執行檔問題

哈~ 我的build machine還是RH9~~
可以算是古董了~~~
不過也沒其它什麼要求~~也就一直沒去更新它
最近裝了一台CentOS起來~~~
碰到一個SELinux的問題~~
還好 Google 一下 馬上就找到答案~~
執行某執行檔時會有以下error ~~
cannot restore segment prot after reloc: Permission denied
解決的方法為:




修改 /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
#SELINUX=enforcing
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted

修改/etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
#SELINUX=enforcing
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted

chcon -t texrel_shlib_t /usr/lib/libxxxx.so


這樣應該就能解決上面的問題


0 意見: