commit-inetutils
[Top][All Lists]
Advanced

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

[SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-98-gcc49b1


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-98-gcc49b1f
Date: Thu, 24 May 2012 19:17:18 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  cc49b1f9c3c7ce696684375f298adab0825f553f (commit)
      from  bc4a16bcd250c497340ac7d22c3d8bd4c2a0531e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=cc49b1f9c3c7ce696684375f298adab0825f553f


commit cc49b1f9c3c7ce696684375f298adab0825f553f
Author: Mats Erik Andersson <address@hidden>
Date:   Thu May 24 21:17:49 2012 +0200

    ftp: Large file offsets.
    
    Integer truncation corrupts offset data.

diff --git a/ChangeLog b/ChangeLog
index 057b10c..d141eba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2012-05-24  Mats Erik Andersson  <address@hidden>
+
+       ftp: Large file support.  The implementation
+       has been truncating offset values.
+
+       * ftp/cmds.c (restart): Convert `restart_point' using atoll().
+       Use a format string `%jd' and cast as `intmax_t'.
+       * ftp/ftp.c (sendrequest): Remove cast of `restart_point'
+       as `long'. Use format string `%jd' and cast as `intmax_t'.
+       (recvrequest): Likewise.  Variables I and N must be `off_t'
+       for computations with `restart_point'.
+
 2012-05-21  Mats Erik Andersson  <address@hidden>
 
        rexecd: Adapt to PAM authentication.
diff --git a/ftp/cmds.c b/ftp/cmds.c
index 0fee735..30c837c 100644
--- a/ftp/cmds.c
+++ b/ftp/cmds.c
@@ -2376,10 +2376,8 @@ restart (int argc, char **argv)
     printf ("restart: offset not specified\n");
   else
     {
-      restart_point = atol (argv[1]);
-      printf ((sizeof (restart_point) > sizeof (long)
-              ? "restarting at %lld. %s\n"
-              : "restarting at %ld. %s\n"), restart_point,
+      restart_point = atoll (argv[1]);
+      printf ("restarting at %jd. %s\n", (intmax_t) restart_point,
              "execute get, put or append to initiate transfer");
     }
 }
diff --git a/ftp/ftp.c b/ftp/ftp.c
index 4f19563..ab13982 100644
--- a/ftp/ftp.c
+++ b/ftp/ftp.c
@@ -637,7 +637,7 @@ sendrequest (char *cmd, char *local, char *remote, int 
printnames)
       switch (curtype)
        {
        case TYPE_A:
-         rc = fseeko (fin, (long) restart_point, SEEK_SET);
+         rc = fseeko (fin, restart_point, SEEK_SET);
          break;
        case TYPE_I:
        case TYPE_L:
@@ -652,7 +652,7 @@ sendrequest (char *cmd, char *local, char *remote, int 
printnames)
            (*closefunc) (fin);
          return;
        }
-      if (command ("REST %ld", (long) restart_point) != CONTINUE)
+      if (command ("REST %jd", (intmax_t) restart_point) != CONTINUE)
        {
          restart_point = 0;
          if (closefunc != NULL)
@@ -887,7 +887,7 @@ recvrequest (char *cmd, char *local, char *remote, char 
*lmode, int printnames)
   if (setjmp (recvabort))
     goto abort;
   if (is_retr && restart_point &&
-      command ("REST %ld", (long) restart_point) != CONTINUE)
+      command ("REST %jd", (intmax_t) restart_point) != CONTINUE)
     return;
   if (remote)
     {
@@ -998,7 +998,8 @@ recvrequest (char *cmd, char *local, char *remote, char 
*lmode, int printnames)
     case TYPE_A:
       if (restart_point)
        {
-         int i, n, ch;
+         off_t i, n;
+         int ch;
 
          if (fseeko (fout, 0L, SEEK_SET) < 0)
            goto done;

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog  |   12 ++++++++++++
 ftp/cmds.c |    6 ++----
 ftp/ftp.c  |    9 +++++----
 3 files changed, 19 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

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