From 60eeb5ae29887dd72da31149a104bc7ddd6f8fabda17dc7bed79e5184771b759 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Thu, 28 May 2009 02:22:38 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libssh?expand=0&rev=3 --- 0001-Map-permission-field-to-type-field.patch | 50 --- 0002-Add-errno-mapping.patch | 366 ------------------ libssh-0.2.tar.bz2 | 3 - libssh-0.3.0.tar.bz2 | 3 + libssh-paths.patch | 53 --- libssh.changes | 40 +- libssh.spec | 115 +++--- libssh_improve_performance.patch | 15 - 8 files changed, 107 insertions(+), 538 deletions(-) delete mode 100644 0001-Map-permission-field-to-type-field.patch delete mode 100644 0002-Add-errno-mapping.patch delete mode 100644 libssh-0.2.tar.bz2 create mode 100644 libssh-0.3.0.tar.bz2 delete mode 100644 libssh-paths.patch delete mode 100644 libssh_improve_performance.patch diff --git a/0001-Map-permission-field-to-type-field.patch b/0001-Map-permission-field-to-type-field.patch deleted file mode 100644 index 5e283c5..0000000 --- a/0001-Map-permission-field-to-type-field.patch +++ /dev/null @@ -1,50 +0,0 @@ -From a07e57e2ed6d402d1f3d4b8449ee4f4ab2108ce7 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Wed, 20 Aug 2008 18:37:33 +0200 -Subject: [PATCH] Map permission field to type field. - ---- - libssh/sftp.c | 23 +++++++++++++++++++++++ - 1 files changed, 23 insertions(+), 0 deletions(-) - -Index: libssh-0.2/libssh/sftp.c -=================================================================== ---- libssh-0.2.orig/libssh/sftp.c -+++ libssh-0.2/libssh/sftp.c -@@ -24,6 +24,8 @@ MA 02111-1307, USA. */ - - #include - #include -+#include -+#include - #include - #include - #include "libssh/priv.h" -@@ -580,6 +582,27 @@ SFTP_ATTRIBUTES *sftp_parse_attr_3(SFTP_ - if(buffer_get_u32(buf,&attr->permissions)!=sizeof(u32)) - break; - attr->permissions=ntohl(attr->permissions); -+ -+ switch (attr->permissions & S_IFMT) { -+ case S_IFSOCK: -+ case S_IFBLK: -+ case S_IFCHR: -+ case S_IFIFO: -+ attr->type = SSH_FILEXFER_TYPE_SPECIAL; -+ break; -+ case S_IFLNK: -+ attr->type = SSH_FILEXFER_TYPE_SYMLINK; -+ break; -+ case S_IFREG: -+ attr->type = SSH_FILEXFER_TYPE_REGULAR; -+ break; -+ case S_IFDIR: -+ attr->type = SSH_FILEXFER_TYPE_DIRECTORY; -+ break; -+ default: -+ attr->type = SSH_FILEXFER_TYPE_UNKNOWN; -+ break; -+ } - } - if(flags & SSH_FILEXFER_ATTR_ACMODTIME){ - if(buffer_get_u32(buf,&attr->atime)!=sizeof(u32)) diff --git a/0002-Add-errno-mapping.patch b/0002-Add-errno-mapping.patch deleted file mode 100644 index fa148b6..0000000 --- a/0002-Add-errno-mapping.patch +++ /dev/null @@ -1,366 +0,0 @@ -From b0b78a34891489b26aaabf71975bed4bc533c9cc Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Wed, 20 Aug 2008 18:38:25 +0200 -Subject: [PATCH] Add errno mapping. - ---- - libssh/sftp.c | 252 ++++++++++++++++++++++++++++++++++++++++++++------------ - 1 files changed, 198 insertions(+), 54 deletions(-) - -Index: libssh-0.2/libssh/sftp.c -=================================================================== ---- libssh-0.2.orig/libssh/sftp.c -+++ libssh-0.2/libssh/sftp.c -@@ -22,6 +22,7 @@ the Free Software Foundation, Inc., 59 T - MA 02111-1307, USA. */ - - -+#include - #include - #include - #include -@@ -393,6 +394,17 @@ SFTP_DIR *sftp_opendir(SFTP_SESSION *sft - sftp_message_free(msg); - if(!status) - return NULL; -+ switch (status->status) { -+ case SSH_FX_NO_SUCH_FILE: -+ errno = ENOENT; -+ break; -+ case SSH_FX_PERMISSION_DENIED: -+ errno = EACCES; -+ break; -+ default: -+ ssh_say(1, "%s:%d - handle status: %d\n", __FILE__, __LINE__, status->status); -+ break; -+ } - ssh_set_error(sftp->session,SSH_REQUEST_DENIED,"sftp server : %s",status->errormsg); - status_msg_free(status); - return NULL; -@@ -709,10 +721,20 @@ SFTP_ATTRIBUTES *sftp_readdir(SFTP_SESSI - sftp_message_free(msg); - if(!status) - return NULL; -- if(status->status==SSH_FX_EOF){ -- dir->eof=1; -+ switch (status->status) { -+ case SSH_FX_NO_SUCH_FILE: -+ errno = ENOENT; -+ break; -+ case SSH_FX_PERMISSION_DENIED: -+ errno = EACCES; -+ break; -+ case SSH_FX_EOF: -+ dir->eof = 1; - status_msg_free(status); - return NULL; -+ default: -+ ssh_say(1, "%s:%d - handle status: %d\n", __FILE__, __LINE__, status->status); -+ break; - } - ssh_set_error(sftp->session,SSH_FATAL,"Unknown error status : %d",status->status); - status_msg_free(status); -@@ -789,12 +811,29 @@ static int sftp_handle_close(SFTP_SESSIO - sftp_message_free(msg); - if(!status) - return -1; -- if(status->status != SSH_FX_OK){ -- ssh_set_error(sftp->session,SSH_REQUEST_DENIED,"sftp server : %s",status->errormsg); -- err=-1; -+ switch (status->status) { -+ case SSH_FX_INVALID_HANDLE: -+ errno = EBADF; -+ break; -+#if 0 -+ case SSH_FX_NO_SPACE_ON_FILESYSTEM: -+ errno = ENOSPC; -+ break; -+ case SSH_FX_QUOTA_EXCEEDED: -+ errno = EDQUOT; -+ break: -+#endif -+ case SSH_FX_OK: -+ status_msg_free(status); -+ return err; -+ break; -+ default: -+ ssh_say(1, "%s:%d - handle status: %d\n", __FILE__, __LINE__, status->status); -+ break; - } -+ ssh_set_error(sftp->session,SSH_REQUEST_DENIED,"sftp server : %s",status->errormsg); - status_msg_free(status); -- return err; -+ return -1; - default: - ssh_set_error(sftp->session,SSH_FATAL,"Received message %d during sftp_handle_close!",msg->packet_type); - sftp_message_free(msg); -@@ -868,6 +907,23 @@ SFTP_FILE *sftp_open(SFTP_SESSION *sftp, - sftp_message_free(msg); - if(!status) - return NULL; -+ switch (status->status) { -+ case SSH_FX_FILE_ALREADY_EXISTS: -+ errno = EEXIST; -+ break; -+ case SSH_FX_NO_SUCH_FILE: -+ errno = ENOENT; -+ break; -+ case SSH_FX_PERMISSION_DENIED: -+ errno = EACCES; -+ break; -+ case SSH_FX_OP_UNSUPPORTED: -+ errno = EINVAL; -+ break; -+ default: -+ ssh_say(1, "%s:%d - handle status: %d\n", __FILE__, __LINE__, status->status); -+ break; -+ } - ssh_set_error(sftp->session,SSH_REQUEST_DENIED,"sftp server : %s",status->errormsg); - status_msg_free(status); - return NULL; -@@ -925,14 +981,21 @@ int sftp_read(SFTP_FILE *handle, void *d - sftp_message_free(msg); - if(!status) - return -1; -- if(status->status != SSH_FX_EOF){ -- ssh_set_error(sftp->session,SSH_REQUEST_DENIED,"sftp server : %s",status->errormsg); -- err=-1; -- } -- else -+ switch (status->status) { -+ case SSH_FX_INVALID_HANDLE: -+ errno = EBADF; -+ break; -+ case SSH_FX_EOF: - handle->eof=1; -+ status_msg_free(status); -+ return err ? err : 0; -+ default: -+ ssh_say(1, "%s:%d - handle status: %d\n", __FILE__, __LINE__, status->status); -+ break; -+ } -+ ssh_set_error(sftp->session,SSH_REQUEST_DENIED,"sftp server : %s",status->errormsg); - status_msg_free(status); -- return err?err:0; -+ return -1; - case SSH_FXP_DATA: - datastring=buffer_get_ssh_string(msg->payload); - sftp_message_free(msg); -@@ -992,13 +1055,22 @@ int sftp_write(SFTP_FILE *file, void *da - sftp_message_free(msg); - if(!status) - return -1; -- if(status->status != SSH_FX_OK){ -- ssh_set_error(sftp->session,SSH_REQUEST_DENIED,"sftp server : %s",status->errormsg); -- err=-1; -+ switch (status->status) { -+ case SSH_FX_INVALID_HANDLE: -+ errno = EBADF; -+ break; -+ case SSH_FX_OK: -+ file->offset+=len; -+ status_msg_free(status); -+ return err ? err : len; -+ default: -+ ssh_say(1, "%s:%d - handle status: %d\n", __FILE__, __LINE__, status->status); -+ break; - } -+ ssh_set_error(sftp->session,SSH_REQUEST_DENIED,"sftp server : %s",status->errormsg); - file->offset+=len; - status_msg_free(status); -- return (err?err:len); -+ return -1; - default: - ssh_set_error(sftp->session,SSH_FATAL,"Received message %d during write!",msg->packet_type); - sftp_message_free(msg); -@@ -1044,14 +1116,27 @@ int sftp_rm(SFTP_SESSION *sftp, char *fi - sftp_message_free(msg); - if (!status) - return -1; -- if (status->status != SSH_FX_OK) { -- /* status should be SSH_FX_OK if the command was successful, if it didn't, then there was an error */ -- ssh_set_error(sftp->session,SSH_REQUEST_DENIED, "sftp server: %s", status->errormsg); -- status_msg_free(status); -- return -1; -+ switch (status->status) { -+ case SSH_FX_FILE_ALREADY_EXISTS: -+ errno = EEXIST; -+ break; -+ case SSH_FX_OP_UNSUPPORTED: -+ errno = EINVAL; -+ break; -+ case SSH_FX_NO_SUCH_FILE: -+ errno = ENOENT; -+ break; -+ case SSH_FX_OK: -+ status_msg_free(status); -+ return 0; -+ default: -+ ssh_say(1, "%s:%d - handle status: %d\n", __FILE__, __LINE__, status->status); -+ break; - } -+ /* status should be SSH_FX_OK if the command was successful, if it didn't, then there was an error */ -+ ssh_set_error(sftp->session,SSH_REQUEST_DENIED, "sftp server: %s", status->errormsg); - status_msg_free(status); -- return 0; /* at this point, everything turned out OK */ -+ return -1; - } else { - ssh_set_error(sftp->session,SSH_FATAL, "Received message %d when attempting to remove file", msg->packet_type); - sftp_message_free(msg); -@@ -1083,18 +1168,21 @@ int sftp_rmdir(SFTP_SESSION *sftp, char - { - status = parse_status_msg(msg); - sftp_message_free(msg); -- if (!status) -- { -+ if (!status) { - return -1; - } -- else if (status->status != SSH_FX_OK) /* status should be SSH_FX_OK if the command was successful, if it didn't, then there was an error */ -- { -- ssh_set_error(sftp->session,SSH_REQUEST_DENIED, "sftp server: %s", status->errormsg); -+ switch (status->status) { -+ case SSH_FX_OK: - status_msg_free(status); -- return -1; -+ return 0; -+ break; -+ default: -+ ssh_say(1, "%s:%d - handle status: %d\n", __FILE__, __LINE__, status->status); -+ break; - } -+ ssh_set_error(sftp->session,SSH_REQUEST_DENIED, "sftp server: %s", status->errormsg); - status_msg_free(status); -- return 0; /* at this point, everything turned out OK */ -+ return -1; - } - else - { -@@ -1111,6 +1199,7 @@ int sftp_mkdir(SFTP_SESSION *sftp, char - STRING *path = string_from_char(directory); - SFTP_MESSAGE *msg = NULL; - STATUS_MESSAGE *status = NULL; -+ SFTP_ATTRIBUTES *errno_attr = NULL; - - buffer_add_u32(buffer, id); - buffer_add_ssh_string(buffer, path); -@@ -1127,17 +1216,30 @@ int sftp_mkdir(SFTP_SESSION *sftp, char - /* by specification, this command's only supposed to return SSH_FXP_STATUS */ - status = parse_status_msg(msg); - sftp_message_free(msg); -- if (!status) -- return -1; -- else -- if (status->status != SSH_FX_OK) { -- /* status should be SSH_FX_OK if the command was successful, if it didn't, then there was an error */ -- ssh_set_error(sftp->session,SSH_REQUEST_DENIED, "sftp server: %s", status->errormsg); -+ switch (status->status) { -+ case SSH_FX_FAILURE: -+ /* -+ * mkdir always returns a failure, even if the path already exists. -+ * To be POSIX conform and to be able to map it to EEXIST a stat -+ * call should be issued here -+ */ -+ errno_attr = sftp_lstat(sftp, directory); -+ if (errno_attr != NULL) { -+ errno = EEXIST; -+ } -+ break; -+ case SSH_FX_OK: - status_msg_free(status); -- return -1; -+ return 0; -+ break; -+ default: -+ ssh_say(1, "%s:%d - handle status: %d\n", __FILE__, __LINE__, status->status); -+ break; - } -+ /* status should be SSH_FX_OK if the command was successful, if it didn't, then there was an error */ -+ ssh_set_error(sftp->session,SSH_REQUEST_DENIED, "sftp server: %s", status->errormsg); - status_msg_free(status); -- return 0; /* at this point, everything turned out OK */ -+ return -1; - } else { - ssh_set_error(sftp->session,SSH_FATAL, "Received message %d when attempting to make directory", msg->packet_type); - sftp_message_free(msg); -@@ -1172,14 +1274,24 @@ int sftp_rename(SFTP_SESSION *sftp, char - sftp_message_free(msg); - if (!status) - return -1; -- else if (status->status != SSH_FX_OK) { -- /* status should be SSH_FX_OK if the command was successful, if it didn't, then there was an error */ -- ssh_set_error(sftp->session,SSH_REQUEST_DENIED, "sftp server: %s", status->errormsg); -+ switch (status->status) { -+ case SSH_FX_FILE_ALREADY_EXISTS: -+ errno = EEXIST; -+ break; -+ case SSH_FX_OP_UNSUPPORTED: -+ errno = EINVAL; -+ break; -+ case SSH_FX_OK: - status_msg_free(status); -- return -1; -+ return 0; -+ default: -+ ssh_say(1, "%s:%d - handle status: %d\n", __FILE__, __LINE__, status->status); -+ break; - } -+ /* status should be SSH_FX_OK if the command was successful, if it didn't, then there was an error */ -+ ssh_set_error(sftp->session,SSH_REQUEST_DENIED, "sftp server: %s", status->errormsg); - status_msg_free(status); -- return 0; /* at this point, everything turned out OK */ -+ return -1; - } else { - ssh_set_error(sftp->session,SSH_FATAL, "Received message %d when attempting to rename", msg->packet_type); - sftp_message_free(msg); -@@ -1212,14 +1324,27 @@ int sftp_setstat(SFTP_SESSION *sftp, cha - sftp_message_free(msg); - if (!status) - return -1; -- else if (status->status != SSH_FX_OK) { -- /* status should be SSH_FX_OK if the command was successful, if it didn't, then there was an error */ -- ssh_set_error(sftp->session,SSH_REQUEST_DENIED, "sftp server: %s", status->errormsg); -+ switch (status->status) { -+ case SSH_FX_NO_SUCH_FILE: -+ errno = ENOENT; -+ break; -+ case SSH_FX_PERMISSION_DENIED: -+ errno = EACCES; -+ break; -+ case SSH_FX_INVALID_HANDLE: -+ errno = EBADF; -+ break; -+ case SSH_FX_OK: - status_msg_free(status); -- return -1; -+ return 0; -+ default: -+ ssh_say(1, "%s:%d - handle status: %d\n", __FILE__, __LINE__, status->status); -+ break; - } -+ /* status should be SSH_FX_OK if the command was successful, if it didn't, then there was an error */ -+ ssh_set_error(sftp->session,SSH_REQUEST_DENIED, "sftp server: %s", status->errormsg); - status_msg_free(status); -- return 0; /* at this point, everything turned out OK */ -+ return -1; - } else { - ssh_set_error(sftp->session,SSH_FATAL, "Received message %d when attempting to set stats", msg->packet_type); - sftp_message_free(msg); -@@ -1302,6 +1427,17 @@ SFTP_ATTRIBUTES *sftp_xstat(SFTP_SESSION - sftp_message_free(msg); - if(!status) - return NULL; -+ switch (status->status) { -+ case SSH_FX_NO_SUCH_FILE: -+ errno = ENOENT; -+ break; -+ case SSH_FX_PERMISSION_DENIED: -+ errno = EACCES; -+ break; -+ default: -+ ssh_say(1, "%s:%d - handle status: %d\n", __FILE__, __LINE__, status->status); -+ break; -+ } - ssh_set_error(sftp->session,SSH_REQUEST_DENIED,"sftp server: %s",status->errormsg); - status_msg_free(status); - return NULL; diff --git a/libssh-0.2.tar.bz2 b/libssh-0.2.tar.bz2 deleted file mode 100644 index edbb79e..0000000 --- a/libssh-0.2.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9818572980459427e3b5bfdf3ad5e94a43e086e9989f126ec1a250d454094136 -size 235758 diff --git a/libssh-0.3.0.tar.bz2 b/libssh-0.3.0.tar.bz2 new file mode 100644 index 0000000..79f4782 --- /dev/null +++ b/libssh-0.3.0.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a91c4959ba256ecaff0b196e8a02f5044e240ac7c86197526b39388a96260bc +size 176903 diff --git a/libssh-paths.patch b/libssh-paths.patch deleted file mode 100644 index 82775db..0000000 --- a/libssh-paths.patch +++ /dev/null @@ -1,53 +0,0 @@ -Index: Makefile.in -=================================================================== ---- Makefile.in (revisiĆ³n: 119) -+++ Makefile.in (copia de trabajo) -@@ -7,12 +7,12 @@ - srcdir = @srcdir@ - prefix = @prefix@ - exec_prefix = @exec_prefix@ --bindir = $(exec_prefix)/bin --incldir= $(prefix)/include --infodir = $(prefix)/info --libdir = $(prefix)/lib --mandir = $(prefix)/share/man --docdir = $(prefix)/share/doc -+bindir = @bindir@ -+incldir= @includedir@ -+infodir = @infodir@ -+libdir = @libdir@ -+mandir = @mandir@ -+docdir = @docdir@ - - CC = @CC@ - CFLAGS = @CFLAGS@ -Iinclude -Wall -Index: libssh/Makefile.in -=================================================================== ---- libssh/Makefile.in (revisiĆ³n: 119) -+++ libssh/Makefile.in (copia de trabajo) -@@ -12,11 +12,11 @@ - srcdir = @srcdir@ - prefix = @prefix@ - exec_prefix = @exec_prefix@ --bindir = $(exec_prefix)/bin --incldir= $(prefix)/include --infodir = $(prefix)/info --libdir = $(prefix)/lib/ --mandir = $(prefix)/man/man1 -+bindir = @bindir@ -+incldir= @includedir@ -+infodir = @infodir@ -+libdir = @libdir@ -+mandir = @mandir@/man1 - - CC = @CC@ - CFLAGS = @CFLAGS@ -Wall -g -I../include/ -@@ -36,7 +36,7 @@ - all: libssh.so - - libssh.la: $(OBJECTS) libssh.vers -- $(LIBTOOL) --mode=link $(CC) -o libssh.la -export-dynamic -version-info $(LIBSSH_CURRENT):$(LIBSSH_REVISION):$(LIBSSH_AGE) -rpath $(libdir) $(OBJECTS:.o=.lo) $(LIBS) $(LIBSSH_LDFLAGS) $(LIBSSH_VERS) $(LDFLAGS) -+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o libssh.la -export-dynamic -version-info $(LIBSSH_CURRENT):$(LIBSSH_REVISION):$(LIBSSH_AGE) -rpath $(libdir) $(OBJECTS:.o=.lo) $(LIBS) $(LIBSSH_LDFLAGS) $(LIBSSH_VERS) - - libssh.so: libssh.la - libssh.a: libssh.la diff --git a/libssh.changes b/libssh.changes index 6915b4e..555aa21 100644 --- a/libssh.changes +++ b/libssh.changes @@ -1,3 +1,33 @@ +------------------------------------------------------------------- +Thu May 21 10:52:35 CEST 2009 - anschneider@exsuse.de + +- Update to version 0.3.0 + * Added support for ssh-agent authentication. + * Added POSIX like sftp implementation. + * Added error checking to all functions. + * Added const to arguments where it was needed. + * Added a channel_get_exit_status() function. + * Added a channel_read_buffer() function, channel_read() is now + a POSIX like function. + * Added a more generic auth callback function. + * Added printf attribute checking for log and error functions. + * Added runtime function tracer support. + * Added NSIS build support with CPack. + * Added openssh hashed host support. + * Added API documentation for all public functions. + * Added asynchronous SFTP read function. + * Added a ssh_bind_set_fd() function. + * Fixed known_hosts parsing. + * Fixed a lot of build warnings. + * Fixed the Windows build. + * Fixed a lot of memory leaks. + * Fixed a double free corruption in the server support. + * Fixed the "ssh_accept:" bug in server support. + * Fixed important channel bugs. + * Refactored the socket handling. + * Switched to CMake build system. + * Improved performance. + ------------------------------------------------------------------- Mon Nov 17 17:46:00 CET 2008 - anschneider@suse.de @@ -15,18 +45,18 @@ Tue Oct 7 21:19:07 CEST 2008 - aj@suse.de ------------------------------------------------------------------- Tue Sep 30 14:02:58 CEST 2008 - ro@suse.de -- add rpmlintrc (desired package name is already taken by another - package) +- Add rpmlintrc (desired package name is already taken by another + package) ------------------------------------------------------------------- Tue Sep 30 13:49:00 CEST 2008 - ro@suse.de -- fix debug package requires +- Fix debug package requires ------------------------------------------------------------------- Tue Sep 30 12:41:19 CEST 2008 - ro@suse.de -- fixed filelist +- Fixed filelist ------------------------------------------------------------------- Thu Aug 21 11:26:29 CEST 2008 - anschneider@suse.de @@ -37,5 +67,5 @@ Thu Aug 21 11:26:29 CEST 2008 - anschneider@suse.de ------------------------------------------------------------------- Wed Aug 20 16:08:57 CEST 2008 - anschneider@suse.de -- initial libssh2 package +- Initial libssh package diff --git a/libssh.spec b/libssh.spec index 4be0003..d8f2705 100644 --- a/libssh.spec +++ b/libssh.spec @@ -1,7 +1,7 @@ # -# spec file for package libssh (Version 0.2) +# spec file for package libssh (Version 0.3.0) # -# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,19 +20,15 @@ Url: http://0xbadc0de.be/wiki/libssh:libssh Name: libssh -BuildRequires: doxygen openssl-devel +BuildRequires: cmake doxygen openssl-devel License: LGPL v2.1 or later Group: System/Libraries -Version: 0.2 -Release: 5 +Version: 0.3.0 +Release: 1 Summary: SSH library Source0: %{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build -Patch00: libssh-paths.patch -Patch01: 0001-Map-permission-field-to-type-field.patch -Patch02: 0002-Add-errno-mapping.patch -Patch03: libssh_improve_performance.patch -%define debug_package_requires libssh2 = %{version}-%{release} +%define debug_package_requires libssh3 = %{version}-%{release} %description The ssh library was designed to be used by programmers needing a @@ -54,12 +50,12 @@ Authors: Aris Adamantiadis Nick Zitzmann -%package -n libssh2 +%package -n libssh3 License: LGPL v2.1 or later Group: System/Libraries Summary: SSH library -%description -n libssh2 +%description -n libssh3 The ssh library was designed to be used by programmers needing a working SSH implementation by the mean of a library. The complete control of the client is made by the programmer. With libssh, you can @@ -83,7 +79,7 @@ Authors: License: LGPL v2.1 or later Group: Development/Libraries/C and C++ Summary: SSH library development headers -Requires: libssh2 = %{version} +Requires: libssh3 = %{version} %description devel Development headers for the SSH library. @@ -112,58 +108,85 @@ Authors: %prep %setup -q -%patch00 -%patch01 -p1 -%patch02 -p1 -%patch03 -p1 %build -autoreconf -fi -%configure \ - --docdir=%{_docdir} \ - --disable-static \ - --with-pic -%{__make} -%{__make} doc +if test ! -e "build"; then + mkdir build +fi +pushd build +cmake \ + -DCMAKE_C_FLAGS:STRING="%{optflags}" \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_SKIP_RPATH=ON \ + -DCMAKE_INSTALL_PREFIX=%{_prefix} \ +%if %{_lib} == lib64 + -DLIB_SUFFIX=64 \ +%endif + %{_builddir}/%{name}-%{version} +%__make %{?jobs:-j%jobs} VERBOSE=1 +%__make doc +popd build %install -%{__make} DESTDIR=%{buildroot} install -%{__make} DESTDIR=%{buildroot} install-doc +pushd build +%if 0%{?suse_version} +%makeinstall +%else +%__make DESTDIR=%{buildroot} install +%endif +popd build -%post -n libssh2 +%post -n libssh3 /sbin/ldconfig -%postun -n libssh2 +%postun -n libssh3 /sbin/ldconfig %clean %{__rm} -rf %{buildroot} -%files -n libssh2 +%files -n libssh3 %defattr(-,root,root) -%doc AUTHORS README CHANGELOG +%doc AUTHORS README ChangeLog %{_libdir}/libssh.so.* %files devel %defattr(-,root,root) -%dir %{_includedir}/libssh/ -%attr(0644,root,root) %{_includedir}/libssh/* +%{_includedir}/libssh %{_libdir}/libssh.so -%exclude %{_libdir}/libssh.la %files devel-doc %defattr(-,root,root) -%dir %{_docdir}/libssh -%dir %{_docdir}/libssh/html -%attr(0644,root,root) %{_docdir}/libssh/html/* -%dir %{_docdir}/libssh/examples -%attr(0644,root,root) %{_docdir}/libssh/examples/* -%attr(0644,root,root) %{_mandir}/man?/ssh_* -%exclude %{_mandir}/man?/buffer_struct.3* -%exclude %{_mandir}/man?/bug.3* -%exclude %{_mandir}/man?/deprecated.3* +%doc build/doc/html %changelog +* Thu May 21 2009 anschneider@exsuse.de +- Update to version 0.3.0 + * Added support for ssh-agent authentication. + * Added POSIX like sftp implementation. + * Added error checking to all functions. + * Added const to arguments where it was needed. + * Added a channel_get_exit_status() function. + * Added a channel_read_buffer() function, channel_read() is now + a POSIX like function. + * Added a more generic auth callback function. + * Added printf attribute checking for log and error functions. + * Added runtime function tracer support. + * Added NSIS build support with CPack. + * Added openssh hashed host support. + * Added API documentation for all public functions. + * Added asynchronous SFTP read function. + * Added a ssh_bind_set_fd() function. + * Fixed known_hosts parsing. + * Fixed a lot of build warnings. + * Fixed the Windows build. + * Fixed a lot of memory leaks. + * Fixed a double free corruption in the server support. + * Fixed the "ssh_accept:" bug in server support. + * Fixed important channel bugs. + * Refactored the socket handling. + * Switched to CMake build system. + * Improved performance. * Mon Nov 17 2008 anschneider@suse.de - Add 'Provides: libssh' to the library that the debuginfo package can be installed. @@ -173,14 +196,14 @@ autoreconf -fi * Tue Oct 07 2008 aj@suse.de - Disable parallel build since it breaks the build. * Tue Sep 30 2008 ro@suse.de -- add rpmlintrc (desired package name is already taken by another +- Add rpmlintrc (desired package name is already taken by another package) * Tue Sep 30 2008 ro@suse.de -- fix debug package requires +- Fix debug package requires * Tue Sep 30 2008 ro@suse.de -- fixed filelist +- Fixed filelist * Thu Aug 21 2008 anschneider@suse.de - Map the permissions field to the type field for sftp v3. - Add errno mapping for sftp functions * Wed Aug 20 2008 anschneider@suse.de -- initial libssh2 package +- Initial libssh package diff --git a/libssh_improve_performance.patch b/libssh_improve_performance.patch deleted file mode 100644 index 8ec77e5..0000000 --- a/libssh_improve_performance.patch +++ /dev/null @@ -1,15 +0,0 @@ -Index: libssh-0.2/libssh/channels.c -=================================================================== ---- libssh-0.2.orig/libssh/channels.c -+++ libssh-0.2/libssh/channels.c -@@ -29,8 +29,8 @@ MA 02111-1307, USA. */ - - #include "libssh/priv.h" - #include "libssh/ssh2.h" --#define WINDOWLIMIT 1024 --#define WINDOWBASE 32000 -+#define WINDOWBASE 128000 -+#define WINDOWLIMIT (WINDOWBASE/2) - - /** defgroup ssh_channel - * \brief functions that manage a channel