Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1340038 - When semanage tool is not available in the system, gdeploy should throw proper error
When semanage tool is not available in the system, gdeploy should throw prope...
Status: CLOSED ERRATA
Product: Red Hat Gluster Storage
Classification: Red Hat
Component: gdeploy (Show other bugs)
3.1
x86_64 Linux
unspecified Severity high
: ---
: RHGS 3.1.3 Async
Assigned To: Sachidananda Urs
SATHEESARAN
: ZStream
Depends On:
Blocks: 1351522
  Show dependency treegraph
 
Reported: 2016-05-26 06:59 EDT by SATHEESARAN
Modified: 2017-03-07 12:41 EST (History)
5 users (show)

See Also:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-02-07 06:33:13 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker 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 11:32:47 EST

  None (edit)
Description SATHEESARAN 2016-05-26 06:59:40 EDT
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 03:37:03 EDT
Fixed in commit: https://github.com/gluster/gdeploy/commit/7082fd44acde6fe144e4c920bbf92da6abbf7810
Comment 3 SATHEESARAN 2016-10-25 05:07:14 EDT
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 06:33:13 EST
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.