Bug 1147717

Summary: free'ing a not-connected agent closes STDIN
Product: Red Hat Enterprise Linux 7 Reporter: Jakub Filak <jfilak>
Component: libssh2Assignee: Kamil Dudka <kdudka>
Status: CLOSED ERRATA QA Contact: Stefan Kremen <skremen>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: jberan, ovasik, skremen
Target Milestone: rcKeywords: EasyFix, Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libssh2-1.4.3-9.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1249581 (view as bug list) Environment:
Last Closed: 2015-11-19 05:21:00 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: 1066486, 1249581    
Attachments:
Description Flags
Example
none
Propsed patch none

Description Jakub Filak 2014-09-29 23:34:13 UTC
Created attachment 942543 [details]
Example

Description of problem:
I had been playing with curl_easy_perform() when I found out that I cannot read from STDIN after uploading to a "scp://" URL.

Version-Release number of selected component (if applicable):
libssh2-1.4.3-8.el7_0.x86_64

How reproducible:
Always

Steps to Reproduce:
1. run the attached example
2.
3.

Actual results:
fcntl(0, F_GETFD): 0
libssh2_agent_{init,connect,free}
fcntl(0, F_GETFD): Bad file descriptor

Expected results:
fcntl(0, F_GETFD): 0
libssh2_agent_{init,connect,free}
fcntl(0, F_GETFD): 0

Additional info:

Comment 1 Jakub Filak 2014-09-29 23:34:56 UTC
Created attachment 942544 [details]
Propsed patch

Comment 4 Kamil Dudka 2014-10-10 11:16:36 UTC
Thanks for the bug report, minimal, example, and patch!

upstream commit:
http://git.libssh2.org/?p=libssh2.git;a=commitdiff;h=1ad20ac7

Comment 5 Kamil Dudka 2014-10-10 12:01:33 UTC
fixed in libssh2-1.4.3-16.fc22, libssh2-1.4.3-16.fc21, libssh2-1.4.3-10.fc20, and libssh2-1.4.3-8.fc19

Comment 12 errata-xmlrpc 2015-11-19 05:21:00 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-2015-2140.html