1
0
mirror of http://galexander.org/git/simplesshd.git synced 2024-12-27 08:28:06 +00:00

now sftp is also 64-bit

This commit is contained in:
Greg Alexander 2016-06-21 21:14:00 -04:00
parent 8fb3ece145
commit 277234865a
2 changed files with 22 additions and 4 deletions

22
NOTES
View File

@ -214,12 +214,30 @@ Of course, this is only if you set the shell to /system/xbin/su as a way
of having root access for rsync. of having root access for rsync.
Anyways, I made a new program, "buffersu", which is just a Anyways, I made a new program, "buffersu", which is just a
stdin/stdout-buffering wrapper for rsync() that is guaranteed to always stdin/stdout-buffering wrapper for rsync that is guaranteed to always
perform any read() that is possible at any time, no matter how many perform any read() that is possible at any time, no matter how many
write()s are outstanding. That seems to do the trick. write()s are outstanding. That seems to do the trick.
XXX - add support for lseek64 and stat64 to sftp June 21, 2016.
Chris Moore reports that rsync and sftp do not like files larger than 2GB.
rsync was easy - it just needed an additional #define in rsync/config.h
to enable its builtin support for using stat64/lseek64/off64_t/etc.
Now that I'm investigating sftp, I find this surprising fact about bionic
(though the glibc man page for stat(2) tried to tell me this) - stat64
and stat are the same thing! But off64_t and lseek64 are significant.
That should make converting sftp pretty convenient. Especially since
sftp already uses "u_int64_t" instead of off_t.
p.s. Chris Moore gave me this command to test sftp, which turned out to
be useful:
curl -v --pubkey .ssh/id_rsa.pub -r 2147482624-2147484672 -k sftp://mushroom:2222/sdcard/ssh/buh -o buh-new
XXX - what about scp? XXX - what about scp?
XXX - test on large files XXX - test on large files
XXX - if you remove it from the recent apps list, does it stop the service?? XXX - if you remove it from the recent apps list, does it stop the service??

View File

@ -646,7 +646,7 @@ process_read(u_int32_t id)
} }
fd = handle_to_fd(handle); fd = handle_to_fd(handle);
if (fd >= 0) { if (fd >= 0) {
if (lseek(fd, off, SEEK_SET) < 0) { if (lseek64(fd, off, SEEK_SET) < 0) {
error("process_read: seek failed"); error("process_read: seek failed");
status = errno_to_portable(errno); status = errno_to_portable(errno);
} else { } else {
@ -684,7 +684,7 @@ process_write(u_int32_t id)
status = SSH2_FX_FAILURE; status = SSH2_FX_FAILURE;
else { else {
if (!(handle_to_flags(handle) & O_APPEND) && if (!(handle_to_flags(handle) & O_APPEND) &&
lseek(fd, off, SEEK_SET) < 0) { lseek64(fd, off, SEEK_SET) < 0) {
status = errno_to_portable(errno); status = errno_to_portable(errno);
error("process_write: seek failed"); error("process_write: seek failed");
} else { } else {