From 41bdcb1b97caaad9be8c2e6f7cd7e349df8ee02f Mon Sep 17 00:00:00 2001 From: Greg Alexander Date: Tue, 21 Jun 2016 21:24:37 -0400 Subject: [PATCH] scp is now 64-bit capable as well, i think --- NOTES | 6 +++++- dropbear/scp.c | 9 +++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/NOTES b/NOTES index 73a49e2..384fdad 100644 --- a/NOTES +++ b/NOTES @@ -237,8 +237,12 @@ be useful: curl -v --pubkey .ssh/id_rsa.pub -r 2147482624-2147484672 -k sftp://mushroom:2222/sdcard/ssh/buh -o buh-new +As for scp, it's not as clear what needs to be done. It doesn't use +lseek. But it does use off_t a bit, including on an index in a for loop +that is compared against st_size (which is 64-bit). So I'll just change +all of the off_t to off64_t and hope for the best. + -XXX - what about scp? XXX - test on large files XXX - if you remove it from the recent apps list, does it stop the service?? XXX - support password-based logins? diff --git a/dropbear/scp.c b/dropbear/scp.c index ec4a076..0181b5e 100644 --- a/dropbear/scp.c +++ b/dropbear/scp.c @@ -84,7 +84,7 @@ void bwlimit(int); arglist args; /* Bandwidth limit */ -off_t limit_rate = 0; +off64_t limit_rate = 0; /* Name of current file being transferred. */ char *curfile; @@ -601,7 +601,8 @@ source(int argc, char **argv) struct stat stb; static BUF buffer; BUF *bp; - off_t i, amt, statbytes; +/* XXX - if PROGRESS_METER is enabled, we'll regret making statbytes 64-bit */ + off64_t i, amt, statbytes; size_t result; int fd = -1, haderr, indx; char *last, *name, buf[2048]; @@ -830,10 +831,10 @@ sink(int argc, char **argv) YES, NO, DISPLAYED } wrerr; BUF *bp; - off_t i; + off64_t i; size_t j, count; int amt, exists, first, mask, mode, ofd, omode; - off_t size, statbytes; + off64_t size, statbytes; int setimes, targisdir, wrerrno = 0; char ch, *cp, *np, *targ, *why, *vect[1], buf[2048]; struct timeval tv[2];