Bug 1464402

Summary: gluster-block: system() check for WIFEXITED before WEXITSTATUS
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Prasanna Kumar Kalever <prasanna.kalever>
Component: gluster-blockAssignee: Prasanna Kumar Kalever <prasanna.kalever>
Status: CLOSED ERRATA QA Contact: Sweta Anandpara <sanandpa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rhgs-3.3CC: amukherj, prasanna.kalever, rhs-bugs, sanandpa, storage-qa-internal
Target Milestone: ---   
Target Release: RHGS 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gluster-block-0.2.1-2.el7rhgs Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-21 04:19:33 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:
Bug Depends On:    
Bug Blocks: 1417151    

Description Prasanna Kumar Kalever 2017-06-23 11:05:41 UTC
Description of problem:

Fix bug in gbRunner() function, which basically execute a command given as part of argument using system() call.

The return value of system() need to defended with WIFEXITED to check check if the child terminated normally before checking for exit status of the child using WEXITSTATUS.

Consequence in absence of this fix will be ending up with an exit value without knowing the proper reason of failure for a given command.

Comment 8 Sweta Anandpara 2017-07-14 06:14:49 UTC
Prasanna, Please refer comment7.

Comment 10 Sweta Anandpara 2017-07-17 07:32:37 UTC
The steps that are mentioned in comment 9 will not pan out that way. 

gluster-block is dependent on tcmu-runner, which in turn is dependent on targetcli. Hence, removal of targetcli will trigger the removal of tcmu-runner AND thus, gluster-block - which, if done, step2 of executing gluster-block commands cannot take place.

Thoughts, Prasanna?

Comment 14 Sweta Anandpara 2017-08-03 09:33:06 UTC
Having discussed it with Prasanna, we can confidently claim that gbRunner() is working correctly with the output that is seen in comment12. 

Moving this bug to verified in 3.3.0.

Comment 16 errata-xmlrpc 2017-09-21 04:19:33 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://access.redhat.com/errata/RHEA-2017:2773