Bug 827813
Summary: | SELinux policy breaks os.path for cobbler | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Pete Travis <me> |
Component: | selinux-policy | Assignee: | Miroslav Grepl <mgrepl> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 18 | CC: | dominick.grift, dwalsh, hakan_duran, jpazdziora, mgrepl |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | selinux-policy-3.11.1-95.fc18 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-05-21 08:40:29 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: | |
Embargoed: |
Description
Pete Travis
2012-06-03 07:02:28 UTC
I built and activated a policy module to allow python to read /etc/passwd. Now, python wants to open /etc/passwd, so I add a module for that. cobbler will start, but python still wants getattr access to /etc/password. Following the addition of a module for this, I am able to start cobblerd without denials. Fixed in selinux-policy-3.10.0-129.fc17 selinux-policy-3.10.0-130.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-130.fc17 Package selinux-policy-3.10.0-130.fc17: * should fix your issue, * was pushed to the Fedora 17 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing selinux-policy-3.10.0-130.fc17' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2012-9520/selinux-policy-3.10.0-130.fc17 then log in and leave karma (feedback). selinux-policy-3.10.0-130.fc17 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report. I have selinux-policy-3.10.0-149.fc17 installed in my box, and I get selinux warning message about /usr/bin/python2.7 attempting getattr access to /etc/passwd. I guess I will build and activate a policy module as described above. Could you execute # semanage permissive -a cobblerd_t re-test it and add your output of # ausearch -m avc -ts recent Thank you. Looks like cobbler needs auth_read_passwd which we have in F18. I see on my F17 allow cobblerd_t passwd_file_t : file { ioctl read getattr lock open } ; It seems the bug is back on Fedora 18: # sesearch --allow -s cobblerd_t -t passwd_file_t Found 1 semantic av rules: allow cobblerd_t file_type : filesystem getattr ; # rpm -q cobbler selinux-policy-targeted cobbler-2.4.0-beta3.fc18.1.noarch selinux-policy-targeted-3.11.1-92.fc18.noarch # avc: denied { read } for pid=2237 comm="cobblerd" name="passwd" dev="dm-1" ino=262820 scontext=system_u:system_r:cobblerd_t:s0 tcontext=system_u:object_r:passwd_file_t:s0 tclass=file # grep cobbler /var/log/messages | perl -ne 's/^.*\[2237\]: // and print' Traceback (most recent call last): File "/usr/lib/python2.7/site.py", line 563, in <module> main() File "/usr/lib/python2.7/site.py", line 545, in main known_paths = addusersitepackages(known_paths) File "/usr/lib/python2.7/site.py", line 278, in addusersitepackages user_site = getusersitepackages() File "/usr/lib/python2.7/site.py", line 253, in getusersitepackages user_base = getuserbase() # this will also set USER_BASE File "/usr/lib/python2.7/site.py", line 243, in getuserbase USER_BASE = get_config_var('userbase') File "/usr/lib/python2.7/sysconfig.py", line 521, in get_config_var return get_config_vars().get(name) File "/usr/lib/python2.7/sysconfig.py", line 425, in get_config_vars _CONFIG_VARS['userbase'] = _getuserbase() File "/usr/lib/python2.7/sysconfig.py", line 183, in _getuserbase return env_base if env_base else joinuser("~", ".local") File "/usr/lib/python2.7/sysconfig.py", line 169, in joinuser return os.path.expanduser(os.path.join(*args)) File "/usr/lib/python2.7/posixpath.py", line 260, in expanduser userhome = pwd.getpwuid(os.getuid()).pw_dir KeyError: 'getpwuid(): uid not found: 0' commit a86527976302b41d2484ae2cf15df0904ec1a344 Author: Miroslav Grepl <mgrepl> Date: Fri May 3 10:19:07 2013 +0200 Allow cobblerd to read /etc/passwd selinux-policy-3.11.1-94.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-94.fc18 Package selinux-policy-3.11.1-94.fc18: * should fix your issue, * was pushed to the Fedora 18 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing selinux-policy-3.11.1-94.fc18' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-7743/selinux-policy-3.11.1-94.fc18 then log in and leave karma (feedback). selinux-policy-3.11.1-95.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-95.fc18 selinux-policy-3.11.1-95.fc18 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report. |