Bug 700890

Summary: Check return value of open() properly in libadmin
Product: [Retired] 389 Reporter: Nathan Kinder <nkinder>
Component: AdminAssignee: Nathan Kinder <nkinder>
Status: CLOSED CURRENTRELEASE QA Contact: Viktor Ashirov <vashirov>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 1.2.8CC: rmeggins
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-07 16:31:48 UTC Type: ---
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: 434915    
Attachments:
Description Flags
Patch for cov#10812 nhosoi: review+

Description Nathan Kinder 2011-04-29 18:27:38 UTC
We do not properly check the return value of open() in the run_cmd() function in libadmin.  The open() function will return -1 if the open failed.  The if condition needs to check if the return value is <= 0 so if can bail out properly.

Comment 1 Nathan Kinder 2011-04-29 18:33:15 UTC
Created attachment 495832 [details]
Patch for cov#10812

Comment 2 Nathan Kinder 2011-04-29 18:43:52 UTC
Pushed to master.  Thanks to Noriko for her reviews!

Counting objects: 9, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 679 bytes, done.
Total 5 (delta 3), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/admin.git
   cc422c4..5a52f43  master -> master

Comment 5 Rich Megginson 2011-06-06 21:40:52 UTC
coverity is clean - marking verified