| Summary: | restorecon from libselinux-python fails on relative paths | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Milos Malik <mmalik> |
| Component: | libselinux | Assignee: | Daniel Walsh <dwalsh> |
| Status: | CLOSED ERRATA | QA Contact: | Milos Malik <mmalik> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 6.1 | CC: | dwalsh, mgrepl, syeghiay, twoerner |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | libselinux-2.0.94-5.1.el6 | Doc Type: | Bug Fix |
| Doc Text: |
Prior to this update, Python bindings for the restorecon command required a user to specify the entire path. Consequent to this, an attempt to use the selinux.restorecon() function with a relative path failed with the following error message:
OSError: [Errno 2] No such file or directory
This update corrects the Python bindings to allow the use of the selinux.restorecon() function with a relative path or just a file name.
|
Story Points: | --- |
| Clone Of: | 695760 | Environment: | |
| Last Closed: | 2011-12-06 10:02:16 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Bug Depends On: | 695760 | ||
| Bug Blocks: | |||
|
Description
Milos Malik
2011-04-21 10:06:47 UTC
I forgot to update the "Actual results" section.
# python s.py
Traceback (most recent call last):
File "s.py", line 11, in <module>
selinux.restorecon(path, True)
File "/usr/lib/python2.6/site-packages/selinux/__init__.py", line 74, in restorecon
status, context = matchpathcon(path, mode)
OSError: [Errno 2] No such file or directory
# echo $?
1
Fixed in libselinux-2.0.94-5.1.el6 # matchpathcon /mnt/testarea/tests/libselinux/Regression/bz698583-relative-paths/ /mnt/testarea/tests/libselinux/Regression/bz698583-relative-paths <<none>> # OK, I will modify the automated test.
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
New Contents:
Prior to this update, Python bindings for the restorecon command required a user to specify the entire path. Consequent to this, an attempt to use the selinux.restorecon() function with a relative path failed with the following error message:
OSError: [Errno 2] No such file or directory
This update corrects the Python bindings to allow the use of the selinux.restorecon() function with a relative path or just a file name.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2011-1559.html |