Archive Index
This month's Index
|
Subject: [ libssh2-Bugs-2800958 ] libssh2_scp_send() does not support files >4GB
[ libssh2-Bugs-2800958 ] libssh2_scp_send() does not support files >4GB
From: SourceForge.net <noreply_at_sourceforge.net>
Date: Tue, 07 Jul 2009 11:14:45 +0000
This mailing list has been abandoned! Subscribe to and use the new list
Bugs item #2800958, was opened at 2009-06-04 10:59
Please note that this message will contain a full copy of the comment thread,
Initial Comment:
The 4th parameter of libssh2_scp_send() is of type size_t. With the ILP32 (default) model, size_t is 32-bits wide. That makes impossible to transfer files larger than 4GB. I've not tested the LP64 model (accessible with -m64 on Sun Studio and probably gcc), but that should work. Nevertheless, size_t is not the appropriate C type for file sizes. POSIX uses off_t, which is either long long (-D_FILE_OFFSET_BITS=64 or LP64 model) or long.
See attached patch (I've used the off_t C type, but fill free to use any 64-bit wide type).
Gaëtan
----------------------------------------------------------------------
>Comment By: Daniel Stenberg (bagder)
Message:
----------------------------------------------------------------------
Comment By: Daniel Stenberg (bagder)
Message:
We should fix this but:
A - we can't change this function without breaking the ABI so I would
B - Using off_t in an API is very error-prone and I really think we need
----------------------------------------------------------------------
Comment By: Gaëtan Buchetet (p82420)
Message:
fd = open(path, O_RDONLY);
Calling libssh2_scp_send() twice with the same parameters overwrites the
----------------------------------------------------------------------
Comment By: Daniel Stenberg (bagder)
Message:
libssh2 supports SCP for files larger than 4GB, but it does not support
libssh2_scp_send() is meant to be called repeatedly over and over with
----------------------------------------------------------------------
You can respond by visiting:
------------------------------------------------------------------------------
|