Accepting request 98260 from devel:libraries:c_c++

- Refresh patches. (forwarded request 98259 from elvigia)

OBS-URL: https://build.opensuse.org/request/show/98260
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh2_org?expand=0&rev=21
This commit is contained in:
Stephan Kulow 2011-12-31 16:19:54 +00:00 committed by Git OBS Bridge
commit 94b56ca8ef
3 changed files with 79 additions and 7 deletions

62
libssh2-ocloexec.patch Normal file
View File

@ -0,0 +1,62 @@
From 33a59a1905feb5d786e9d457f287dd9e81a9f747 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= <crrodriguez@opensuse.org>
Date: Tue, 27 Dec 2011 00:33:28 -0300
Subject: [PATCH] Use O_CLOEXEC where needed
---
src/agent.c | 2 +-
src/knownhost.c | 4 ++--
src/userauth.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/agent.c b/src/agent.c
index 5a9e81c..af939a1 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -152,7 +152,7 @@ agent_connect_unix(LIBSSH2_AGENT *agent)
return _libssh2_error(agent->session, LIBSSH2_ERROR_BAD_USE,
"no auth sock variable");
- agent->fd = socket(PF_UNIX, SOCK_STREAM, 0);
+ agent->fd = socket(PF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
if (agent->fd < 0)
return _libssh2_error(agent->session, LIBSSH2_ERROR_BAD_SOCKET,
"failed creating socket");
diff --git a/src/knownhost.c b/src/knownhost.c
index 193bda3..418c08a 100644
--- a/src/knownhost.c
+++ b/src/knownhost.c
@@ -907,7 +907,7 @@ libssh2_knownhost_readfile(LIBSSH2_KNOWNHOSTS *hosts,
"Unsupported type of known-host information "
"store");
- file = fopen(filename, "r");
+ file = fopen(filename, "re");
if(file) {
while(fgets(buf, sizeof(buf), file)) {
if(libssh2_knownhost_readline(hosts, buf, strlen(buf), type))
@@ -1079,7 +1079,7 @@ libssh2_knownhost_writefile(LIBSSH2_KNOWNHOSTS *hosts,
"Unsupported type of known-host information "
"store");
- file = fopen(filename, "w");
+ file = fopen(filename, "we");
if(!file)
return _libssh2_error(hosts->session, LIBSSH2_ERROR_FILE,
"Failed to open file");
diff --git a/src/userauth.c b/src/userauth.c
index 3fcb200..0f48a1d 100644
--- a/src/userauth.c
+++ b/src/userauth.c
@@ -467,7 +467,7 @@ file_read_publickey(LIBSSH2_SESSION * session, unsigned char **method,
_libssh2_debug(session, LIBSSH2_TRACE_AUTH, "Loading public key file: %s",
pubkeyfile);
/* Read Public Key */
- fd = fopen(pubkeyfile, "r");
+ fd = fopen(pubkeyfile, "re");
if (!fd) {
return _libssh2_error(session, LIBSSH2_ERROR_FILE,
"Unable to open public key file");
--
1.7.7

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Tue Dec 27 03:41:32 UTC 2011 - crrodriguez@opensuse.org
- Refresh patches.
-------------------------------------------------------------------
Thu Dec 1 03:41:02 UTC 2011 - jengelh@medozas.de
- Remove redundant/unwanted tags/section (cf. specfile guidelines)
-------------------------------------------------------------------
Thu Dec 1 02:43:46 UTC 2011 - crrodriguez@opensuse.org
- open library file descriptors with O_CLOEXEC
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Oct 21 18:15:49 UTC 2011 - crrodriguez@opensuse.org Fri Oct 21 18:15:49 UTC 2011 - crrodriguez@opensuse.org

View File

@ -33,6 +33,7 @@ BuildRequires: zlib-devel
#for the test suite #for the test suite
BuildRequires: openssh BuildRequires: openssh
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
Patch: libssh2-ocloexec.patch
%description %description
libssh2 is a library implementing the SSH2 protocol as defined by libssh2 is a library implementing the SSH2 protocol as defined by
@ -40,10 +41,7 @@ Internet Drafts: SECSH-TRANS, SECSH-USERAUTH, SECSH-CONNECTION,
SECSH-ARCH, SECSH-FILEXFER, SECSH-DHGEX, SECSH-NUMBERS, and SECSH-ARCH, SECSH-FILEXFER, SECSH-DHGEX, SECSH-NUMBERS, and
SECSH-PUBLICKEY. SECSH-PUBLICKEY.
%define debug_package_requires libssh2-1 = %{version}-%{release}
%package -n libssh2-1 %package -n libssh2-1
License: BSD3c
Summary: A library implementing the SSH2 protocol Summary: A library implementing the SSH2 protocol
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
@ -54,7 +52,6 @@ SECSH-ARCH, SECSH-FILEXFER, SECSH-DHGEX, SECSH-NUMBERS, and
SECSH-PUBLICKEY. SECSH-PUBLICKEY.
%package -n libssh2-devel %package -n libssh2-devel
License: BSD3c
Summary: A library implementing the SSH2 protocol Summary: A library implementing the SSH2 protocol
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
Requires: glibc-devel Requires: glibc-devel
@ -68,6 +65,7 @@ SECSH-PUBLICKEY.
%prep %prep
%setup -q -n %{pkg_name}-%{version} %setup -q -n %{pkg_name}-%{version}
%patch -p1
%build %build
export CFLAGS="%optflags -DOPENSSL_LOAD_CONF" export CFLAGS="%optflags -DOPENSSL_LOAD_CONF"
@ -87,9 +85,6 @@ rm -f %{buildroot}%{_libdir}/*.la
make check make check
%endif %endif
%clean
rm -rf %{buildroot}
%post -n libssh2-1 -p /sbin/ldconfig %post -n libssh2-1 -p /sbin/ldconfig
%postun -n libssh2-1 -p /sbin/ldconfig %postun -n libssh2-1 -p /sbin/ldconfig