- Based on a patch in bug #1878059 by Steven Ayre libssh2 now parses >2GB file

sizes when downloading SCP files.
This commit is contained in:
Daniel Stenberg
2008-09-29 14:04:01 +00:00
parent bd3dfed7e8
commit 93ae080bbc
4 changed files with 21 additions and 5 deletions

6
NEWS
View File

@@ -1,7 +1,11 @@
Version 0.19 ( )
-------------------------------
- Bug #2064371 pointed out that the SSH2 banner may not use dash ('-').
- Based on a patch in bug #1878059 by Steven Ayre libssh2 now parses >2GB file
sizes when downloading SCP files.
- Bug #2064371 pointed out that the SSH2 banner may not use dash ('-'). Reported
by Bjorn Stenborg.
- Sean Peterson fixed a key re-exchange bug:
http://daniel.haxx.se/projects/libssh2/mail/libssh2-devel-archive-2008-06/0002.shtml

View File

@@ -40,6 +40,11 @@ case "$host" in
;;
esac
AC_CHECK_TYPE(long long,
[AC_DEFINE(HAVE_LONGLONG, 1,
[Define to 1 if the compiler supports the 'long long' data type.])]
longlong="yes"
)
# Some systems (Solaris?) have socket() in -lsocket.
AC_SEARCH_LIBS(socket, socket)
@@ -249,7 +254,7 @@ AC_HELP_STRING([--disable-debug],[Disable debug options]),
AC_CHECK_HEADERS([errno.h fcntl.h stdio.h stdlib.h unistd.h sys/uio.h])
AC_CHECK_HEADERS([sys/select.h sys/socket.h sys/ioctl.h sys/time.h])
AC_CHECK_HEADERS([arpa/inet.h netinet/in.h])
AC_CHECK_FUNCS(poll gettimeofday select)
AC_CHECK_FUNCS(poll gettimeofday select strtoll)
AC_FUNC_ALLOCA

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2004-2007, Sara Golemon <sarag@libssh2.org>
/* Copyright (c) 2004-2008, Sara Golemon <sarag@libssh2.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms,
@@ -811,7 +811,14 @@ struct _LIBSSH2_SESSION
unsigned char scpRecv_response[LIBSSH2_SCP_RESPONSE_BUFLEN];
unsigned long scpRecv_response_len;
long scpRecv_mode;
#if defined(HAVE_LONGLONG) && defined(strtoll)
/* we have the type and we can parse such numbers */
long long scpRecv_size;
#define scpsize_strtol strtoll
#else
long scpRecv_size;
#define scpsize_strtol strtol
#endif
long scpRecv_mtime;
long scpRecv_atime;
char *scpRecv_err_msg;

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2004-2007, Sara Golemon <sarag@libssh2.org>
/* Copyright (c) 2004-2008, Sara Golemon <sarag@libssh2.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms,
@@ -487,7 +487,7 @@ libssh2_scp_recv(LIBSSH2_SESSION * session, const char *path, struct stat * sb)
*(s++) = '\0';
/* Make sure we don't get fooled by leftover values */
errno = 0;
session->scpRecv_size = strtol(p, &e, 10);
session->scpRecv_size = scpsize_strtol(p, &e, 10);
if ((e && *e) || errno) {
libssh2_error(session, LIBSSH2_ERROR_SCP_PROTOCOL,
"Invalid response from SCP server, invalid size",