| Summary: | Selinux does not keep the context | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Japplo <martincd> |
| Component: | policycoreutils | Assignee: | Daniel Walsh <dwalsh> |
| Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 17 | CC: | dwalsh, martin_, mgrepl |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2012-04-23 17:41:19 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Japplo
2012-04-21 07:34:09 UTC
So you are saying the restorecon is actully not setting the file context. ls -lZ /opt/qtsdk/Madde/sysroots/harmattan_sysroot_10.2011.34-1_slim/var/lib/usbutils/usb.ids Does the following report an error? # chcon -t var_lib_t /opt/qtsdk/Madde/sysroots/harmattan_sysroot_10.2011.34-1_slim/var/lib/usbutils/usb.ids It seems, that the file context is OK but restorecon shows a reset: # ls -lZ /opt/qtsdk/Madde/sysroots/harmattan_sysroot_10.2011.34-1_slim/var/lib/usbutils/usb.ids -rw-r--r--. japplo japplo system_u:object_r:var_lib_t:s0 /opt/qtsdk/Madde/sysroots/harmattan_sysroot_10.2011.34-1_slim/var/lib/usbutils/usb.ids # restorecon -R -v /opt/qtsdk/ | grep "usbutils/usb.ids" restorecon reset /opt/qtsdk/Madde/sysroots/harmattan_sysroot_10.2011.34-1_slim/var/lib/usbutils/usb.ids context system_u:object_r:usr_t:s0->system_u:object_r:var_lib_t:s0 # chcon -t var_lib_t /opt/qtsdk/Madde/sysroots/harmattan_sysroot_10.2011.34-1_slim/var/lib/usbutils/usb.ids # restorecon -R -v /opt/qtsdk/Madde/sysroots/harmattan_sysroot_10.2011.34-1_slim/var/ | grep "usbutils/usb.ids" Thanks japplo Is this file hard linked somewhere else? IE if the Inode is in bodth /var/lib and in another directory under /opt, restorecon could be changing the label twice. Once to var_lib_t and once to usr_t, depending on the path to the inode. ls -i /opt/qtsdk/Madde/sysroots/harmattan_sysroot_10.2011.34-1_slim/var/lib/usbutils/ 805828 usb.ids find / -inum 805828 /opt/qtsdk/Madde/sysroots/harmattan_sysroot_10.2011.34-1_slim/usr/share/misc/usb.ids /opt/qtsdk/Madde/sysroots/harmattan_sysroot_10.2011.34-1_slim/var/lib/usbutils/usb.ids OK, thanks, you are right. But how can I overcome the relabeling issue? You need to have the same labeling for both files. You will need to use the "semanage" tool to add labeling. semanage fcontext -a -t var_lib_t /opt/qtsdk/Madde/sysroots/harmattan_sysroot_10.2011.34-1_slim/var/lib/usbutils/usb.ids ok, many thanks |