有关SELinux的文档访问权限的trouble-shooting
来源:
ChinaUnix博客 作者: 发布时间:2007-01-01 17:46:00


在关机时发现屏幕显示如下信息:
audit(1184488359.148:1967):
avc: denied { read } for pid=2418 comm="hald-addon-stor"
name="hdd" dev=tmpfs ino=6015
scontext=system_u:system_r:hald_t:s0
tcontext=system_u:object_r:device_t:s0 tclass=blk_file
事实上,按CTRL+ALT+F1~F6转换到其他非X-window下的终端,会发现系统不停地提示这一信息,导致无法正常在终端进行工作。
查看系统日志/var/log/messages,会发现其中几乎全部充斥着这一垃圾信息。
这个问题和使用SELinux时,访问权限的配置有关。具体能够参考
Adding Permissions Using SELinux
中的说明和解决办法。
出问题的文档名字由name="hdd"标识,使用locate hdd命令,结合上述信息能够判定文档为/dev/hdd。
检查该文档的security context:
[root@localhost
~]# ls -Z /dev/hdd
brw-rw----
root disk system_u:object_r:device_t /dev/hdd
修改文档/etc/selinux/targeted/contexts/files/file_contexts,在其中加入如下一行(注意修改前先备份):
/dev/hdd -- system_u:system_r:hald_t:s0
修改完毕,对该文档进行relabel:
[root@localhost files]# setfiles file_contexts /dev/hdd
setfiles:
labeling files under /dev/hdd
matchpathcon_filespec_eval:
hash table stats: 1 elements, 1/65536 buckets used, longest chain
length 1
setfiles:
Done.
再次检查:
[root@localhost ~]# ls -Z /dev/hdd
brw-rw---- root disk system_u:object_r:fixed_disk_device_t /dev/hdd
进入非X-windows终端,无上述错误信息出现。
这时问题得以解决。
|
还没有关于此文章的相关评论!