Resolves: #1147717 - prevent a not-connected agent from closing STDIN

This commit is contained in:
Kamil Dudka 2014-10-10 13:22:55 +02:00
parent aa67a47340
commit 384b1c0765
2 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,31 @@
From a958624be229315ab57017040ef15c5ae072d1ac Mon Sep 17 00:00:00 2001
From: Matthias Kerestesch <mail@kerestesch.de>
Date: Sat, 18 May 2013 23:01:35 +0200
Subject: [PATCH] libssh2_agent_init: init ->fd to LIBSSH2_INVALID_SOCKET
... previously it was left at 0 which is a valid file descriptor!
Bug: https://trac.libssh2.org/ticket/265
Fixes #265
Upstream-commit: 1ad20ac7d3e21d091e7cfec58fda0afdc359360a
---
src/agent.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/agent.c b/src/agent.c
index 1c65149..a8a5025 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -652,6 +652,7 @@ libssh2_agent_init(LIBSSH2_SESSION *session)
return NULL;
}
memset(agent, 0, sizeof *agent);
+ agent->fd = LIBSSH2_INVALID_SOCKET;
agent->session = session;
_libssh2_list_init(&agent->head);
--
2.1.0

View File

@ -12,7 +12,7 @@
Name: libssh2
Version: 1.4.3
Release: 15%{?dist}
Release: 16%{?dist}
Summary: A library implementing the SSH2 protocol
Group: System Environment/Libraries
License: BSD
@ -30,6 +30,7 @@ Patch8: 0008-_libssh2_channel_read-fix-data-drop-when-out-of-wind.patch
Patch9: 0009-_libssh2_channel_read-Honour-window_size_initial.patch
Patch10: 0010-Set-default-window-size-to-2MB.patch
Patch11: 0011-channel_receive_window_adjust-store-windows-size-alw.patch
Patch12: 0012-libssh2_agent_init-init-fd-to-LIBSSH2_INVALID_SOCKET.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -nu)
BuildRequires: openssl-devel
BuildRequires: zlib-devel
@ -102,6 +103,9 @@ sed -i s/4711/47%{?__isa_bits}/ tests/ssh2.{c,sh}
%patch10 -p1
%patch11 -p1
# prevent a not-connected agent from closing STDIN (#1147717)
%patch12 -p1
# Make sshd transition appropriately if building in an SELinux environment
%if !(0%{?fedora} >= 17 || 0%{?rhel} >= 7)
chcon $(/usr/sbin/matchpathcon -n /etc/rc.d/init.d/sshd) tests/ssh2.sh || :
@ -176,6 +180,9 @@ rm -rf %{buildroot}
%{_libdir}/pkgconfig/libssh2.pc
%changelog
* Fri Oct 10 2014 Kamil Dudka <kdudka@redhat.com> 1.4.3-16
- prevent a not-connected agent from closing STDIN (#1147717)
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.3-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild