Bug 1460818

Summary: python3 type change from selinux.security_get_boolean_names
Product: [Fedora] Fedora Reporter: Dusty Mabe <dustymabe>
Component: libselinuxAssignee: Petr Lautrbach <plautrba>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: dwalsh, mgrepl, plautrba, pmoore, vmojzis
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-13 12:41:17 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 Dusty Mabe 2017-06-12 20:58:14 UTC
Description of problem:

In Fedora 25 the return type of the items in the list returned by the python3 selinux.security_get_boolean_names() was 'bytes'. In Fedora 26 this is 'str'.

This causes the ansible seboolean module to blow up here: https://github.com/ansible/ansible/blob/025b52938eb449b48e6ac57254161ad4673ab79c/lib/ansible/modules/system/seboolean.py#L76-L85


Output from f25:
```
[root@vanilla-f25atomic ~]# rpm -q libselinux-python libselinux-python3
libselinux-python-2.5-13.fc25.x86_64
libselinux-python3-2.5-13.fc25.x86_64
[root@vanilla-f25atomic ~]# python3 -c "import selinux; print(type(selinux.security_get_boolean_names()[1][0]))"
<class 'bytes'>
[root@vanilla-f25atomic ~]# 
[root@vanilla-f25atomic ~]# python -c "import selinux; print(type(selinux.security_get_boolean_names()[1][0]))"
<type 'str'>
```

Output from f26:
```
[root@f1 ~]# rpm -q libselinux-python libselinux-python3 
libselinux-python-2.6-6.fc26.x86_64
libselinux-python3-2.6-6.fc26.x86_64
[root@f1 ~]# python3 -c "import selinux; print(type(selinux.security_get_boolean_names()[1][0]))"
<class 'str'>
[root@f1 ~]# python -c "import selinux; print(type(selinux.security_get_boolean_names()[1][0]))"
<type 'str'>
```

Comment 1 Dusty Mabe 2017-06-12 21:00:27 UTC
We are trying to find out if this change was intentional or not.

Comment 2 Petr Lautrbach 2017-06-13 08:54:25 UTC
This change was intentional. The previous version was causing issues
with string manipulation functions like split()

https://github.com/SELinuxProject/selinux/commit/b8711e2eaf4f83bf943ac8ad28c35cb1db9c001f

Comment 3 Dusty Mabe 2017-06-13 12:41:17 UTC
Thanks for the update - I opened a bug upstream against ansible: https://github.com/ansible/ansible/issues/25651