Bug 1048524

Summary: semanage can't set selinux type, "invalid MLS context None" error
Product: [Fedora] Fedora Reporter: František Dvořák <valtri>
Component: policycoreutilsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 20CC: dwalsh, jpazdziora, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: policycoreutils-2.2.5-1.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-09 07:40:03 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 František Dvořák 2014-01-04 20:48:40 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 František Dvořák 2014-01-04 20:56:03 UTC
Description of problem:

semanage can't set selinux type


Version-Release number of selected component (if applicable):

policycoreutils-python-2.2.4-5.fc20.x86_64
selinux-policy-targeted-3.12.1-106.fc20.noarch


How reproducible:

Always.


Steps to Reproduce:
1. yum install policycoreutils-python
2. mkdir -p /var/lib/bdii/db
3. semanage fcontext -a -t slapd_db_t "/var/lib/bdii/db(/.*)?"
4. ls -laZ /var/lib/bdii/db


Actual results:

libsepol.mls_from_string: invalid MLS context None (No such file or directory).
libsepol.mls_from_string: could not construct mls context structure (No such file or directory).
libsepol.context_from_record: could not create context structure (Invalid argument).
libsemanage.validate_handler: invalid context system_u:object_r:slapd_db_t:None specified for /var/lib/bdii/db(/.*)? [all files] (Invalid argument).
libsemanage.dbase_llist_iterate: could not iterate over records (Invalid argument).
ValueError: Could not commit semanage transaction

drwxr-xr-x. ldap ldap system_u:object_r:var_lib_t:s0   .
drwxr-xr-x. ldap ldap system_u:object_r:var_lib_t:s0   ..


Expected results:

slapd_db_t selinux type set


Additional info:

I found this problem during installing and using bdii ==> alternative steps to reproducing (where error messages are suppressed in %post install scripts):

yum install bdii
systemctl start bdii.service
ls -laZ /var/lib/bdii/db

Comment 2 František Dvořák 2014-01-05 19:32:16 UTC
Additional observations:
- doesn't work also in the newer version from testing: policycoreutils-2.2.4-6.fc20.x86_64
- working fine in previous version: policycoreutils-2.2.2-3.fc20.x86_64

Comment 3 Miroslav Grepl 2014-01-06 08:49:51 UTC
Dan, 
I sent you a patch.

Comment 4 Daniel Walsh 2014-01-06 18:09:23 UTC
Lets Try policycoreutils-2.2.5-1.fc20

Comment 5 Fedora Update System 2014-01-06 18:45:42 UTC
policycoreutils-2.2.5-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/FEDORA-2014-0088/policycoreutils-2.2.5-1.fc20

Comment 6 Fedora Update System 2014-01-07 09:43:05 UTC
Package policycoreutils-2.2.5-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing policycoreutils-2.2.5-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-0088/policycoreutils-2.2.5-1.fc20
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2014-01-09 07:40:03 UTC
policycoreutils-2.2.5-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.