scp with files > 2gb

Darren Moffat Darren.Moffat at eng.sun.com
Sat Apr 21 06:26:48 EST 2001


A while back someone posted a patch for scp that updates it to deal with
files > 2gb by using 64 bit offsets as defined by LFS (Large File Sumit).

I belive the patch was tested on Linux but maybe not on other systems
that support largefiles.

I've tried this under Solaris and scp fails with a broken pipe on only the
second write to the pipe between scp and ssh if the file is over 2gb.
If the file is under 2gb it works fine.

it fails the second time around the for loop that looks like this in
scp.c:source()

	for (haderr = i = 0; i < stb.st_size; i += bp->cnt) {
		amt = bp->cnt;
		if (i + amt > stb.st_size)
			amt = stb.st_size - i;
		if (!haderr) {
SIGPIPE =====>>>	result = atomicio(read, fd, bp->buf, amt);
		....		
	}
	
scp from: OpenSSH 2.5.1p2

client and server both Solaris.

Any comments ?

--
Darren J Moffat




More information about the openssh-unix-dev mailing list