[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-inetutils] [PATCH] rcp: fix the rcp doesn't work with large file

From: Wenlin Kang
Subject: [bug-inetutils] [PATCH] rcp: fix the rcp doesn't work with large file
Date: Wed, 15 Jul 2015 15:48:09 +0800

When copy file by rcp command, if the file > 2GB, it will not work.

On host(Ubuntu 12.04.4 LTS):
address@hidden:/build#du -sh file2_2G_h.img
2.1G    file2_2G_h.img
address@hidden:/build#$rcp file2_2G_h.img address@hidden:/media/sda4/test
rcp: lost connection

On target(inetutils has installed):
address@hidden:/media/sda4/test1# rcp address@hidden:/build/file2_2G_h.img .
rcp: rcp[970]: segfault at 22 ip 000000391dc47ec7 sp 00007ffd858e2d50 error 4 
in libc-2.18.so[391dc00000+1a3000]
Segmentation fault

The cause is that it used incorrect data type on file size in sink() of rcp.
The patch also references the follow link:

Signed-off-by: address@hidden
Signed-off-by: Wenlin Kang <address@hidden>
 src/rcp.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/rcp.c b/src/rcp.c
index 21f55b6..bafa35f 100644
--- a/src/rcp.c
+++ b/src/rcp.c
@@ -876,9 +876,9 @@ sink (int argc, char *argv[])
   { YES, NO, DISPLAYED } wrerr;
   BUF *bp;
-  off_t i, j;
+  off_t i, j, size;
   int amt, count, exists, first, mask, mode, ofd, omode;
-  int setimes, size, targisdir, wrerrno;
+  int setimes, targisdir, wrerrno;
   char ch, *cp, *np, *targ, *vect[1], buf[BUFSIZ];
   const char *why;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]