Bug 1340038 - When semanage tool is not available in the system, gdeploy should throw proper error
Summary: When semanage tool is not available in the system, gdeploy should throw prope...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat
Component: gdeploy
Version: rhgs-3.1
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
: RHGS 3.1.3 Async
Assignee: Sachidananda Urs
QA Contact: SATHEESARAN
URL:
Whiteboard:
Depends On:
Blocks: 1351522
TreeView+ depends on / blocked
 
Reported: 2016-05-26 10:59 UTC by SATHEESARAN
Modified: 2017-03-07 17:41 UTC (History)
5 users (show)

Fixed In Version: gdeploy-2.0.1-1
Doc Type: Bug Fix
Doc Text:
Previously, if SELinux Policy Management tool was not installed, gdeploy did not display any error. Hence, the SELinux context was not being set. With this update, gdeploy throws error if SELinux Policy Management tool is not installed on the machine.
Clone Of:
Environment:
Last Closed: 2017-02-07 11:33:13 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:0260 normal SHIPPED_LIVE Important: ansible and gdeploy security and bug fix update 2017-02-07 16:32:47 UTC

Description SATHEESARAN 2016-05-26 10:59:40 UTC
Description of problem:
------------------------
When 'semanage' binary tool is not available in the system,and gdeploy while executing the config script which has a 'selinux' section set to 'yes', should throw proper error message.

Currently gdeploy doesn't throw any warning and silently exits, which the user will take as success. But in reality, the correct selinux labels are not set on the gluster bricks, if semanage tool is not available. 


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

How reproducible:
-----------------
Always

Steps to Reproduce:
-------------------
1. Make sure to remove - 'policycoreutils-python' package which supplies 'semanage' tool. 

Note: When I installed RHEL 7.2 from iso, I never had policycoreutils-python package installed

2. Create a config file with [selinux] section set to 'yes
[hosts]
...
[pv]
...
[vg]
...
[lv1]
...
[lv2]
...
[selinux]
yes

3. Execute the script

Actual results:
---------------
gdeploy completes successfully

Expected results:
-----------------
As the config file has requirement to selinux labels to set on bricks, if 'semanage' tool is not available, then gdeploy should complain about it and should not complete silently

Comment 1 Sachidananda Urs 2016-06-23 07:37:03 UTC
Fixed in commit: https://github.com/gluster/gdeploy/commit/7082fd44acde6fe144e4c920bbf92da6abbf7810

Comment 3 SATHEESARAN 2016-10-25 09:07:14 UTC
Tested with gdeploy-2.0.1-2.el7rhgs

When 'semanage' command is not available, gdeploy throws relevant errors and doesn't fail quietly as it used to do earlier.

Errors are as follows :

"failed: [dhcp37-172.lab.eng.blr.redhat.com] (item={u'device': u'/dev/GLUSTER_vg1/GLUSTER_lv1', u'path': u'/gluster/brick1'}) => {"changed": true, "cmd": "semanage fcontext -a -t glusterd_brick_t /gluster/brick1", "delta": "0:00:00.002824", "end": "2016-10-25 20:12:25.106210", "failed": true, "item": {"device": "/dev/GLUSTER_vg1/GLUSTER_lv1", "path": "/gluster/brick1"}, "rc": 127, "start": "2016-10-25 20:12:25.103386", "stderr": "/bin/sh: semanage: command not found", "stdout": "", "stdout_lines": [], "warnings": []}"

Comment 7 errata-xmlrpc 2017-02-07 11:33:13 UTC
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.

https://rhn.redhat.com/errata/RHSA-2017-0260.html


Note You need to log in before you can comment on or make changes to this bug.