pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/net/rdist6 Update lukem's earlier fixes to use intmax_...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/50fa9849a1bc
branches:  trunk
changeset: 576490:50fa9849a1bc
user:      dholland <dholland%pkgsrc.org@localhost>
date:      Sat Jun 12 19:36:00 2010 +0000

description:
Update lukem's earlier fixes to use intmax_t for printing/reading time_t
values, and also for (perhaps not all) off_t values. And while here, fix
an unrelated LP64 bug calling execl(). PKGREVISION -> 4.

diffstat:

 net/rdist6/Makefile         |   4 +-
 net/rdist6/distinfo         |  10 ++-
 net/rdist6/patches/patch-ai |  73 +++++++++++++++++++++++++++++++---
 net/rdist6/patches/patch-an |  93 +++++++++++++++++++++++++++++++++++++++-----
 net/rdist6/patches/patch-ao |   6 +-
 net/rdist6/patches/patch-ap |  14 ++++++
 net/rdist6/patches/patch-aq |  16 +++++++
 7 files changed, 188 insertions(+), 28 deletions(-)

diffs (truncated from 312 to 300 lines):

diff -r b95e4d1d705d -r 50fa9849a1bc net/rdist6/Makefile
--- a/net/rdist6/Makefile       Sat Jun 12 16:12:25 2010 +0000
+++ b/net/rdist6/Makefile       Sat Jun 12 19:36:00 2010 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.21 2010/03/07 08:52:27 lukem Exp $
+# $NetBSD: Makefile,v 1.22 2010/06/12 19:36:00 dholland Exp $
 #
 
 DISTNAME=      freerdist-0.92
-PKGREVISION=   3
+PKGREVISION=   4
 CATEGORIES=    net
 MASTER_SITES=  ftp://ftp.astron.com/pub/freerdist/
 
diff -r b95e4d1d705d -r 50fa9849a1bc net/rdist6/distinfo
--- a/net/rdist6/distinfo       Sat Jun 12 16:12:25 2010 +0000
+++ b/net/rdist6/distinfo       Sat Jun 12 19:36:00 2010 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.13 2010/03/07 08:52:27 lukem Exp $
+$NetBSD: distinfo,v 1.14 2010/06/12 19:36:00 dholland Exp $
 
 SHA1 (freerdist-0.92.tar.gz) = 84db4efd8d223a7e10d62e386349aa9236f71ae3
 RMD160 (freerdist-0.92.tar.gz) = 2106cbf21fbe6fda2738d2e9e2d750625eb8c2da
@@ -11,10 +11,12 @@
 SHA1 (patch-af) = c91cfab8609a6b8fe0df051ac8a2d29154ff5aad
 SHA1 (patch-ag) = 0049876208f0466b6a725bb4bc04097ed603c89c
 SHA1 (patch-ah) = 35bda080c8b816b1e76f643548679dacbc10d2af
-SHA1 (patch-ai) = f03704bddc2e35000ba6597bb0310a98bf2c26d4
+SHA1 (patch-ai) = 3946ce9f33830137be32abda416c52e3f1bcac8d
 SHA1 (patch-aj) = db6307ff40a8db7428fc23f7cfd40a3152c465dc
 SHA1 (patch-ak) = a65735786a4cbe19874e83cdc8ac2d6aadb8c14e
 SHA1 (patch-al) = f40942171206e5191051bf3e699d4c1977a4deb1
 SHA1 (patch-am) = 26655eccc7b2051f42dc57004161263777c80f8d
-SHA1 (patch-an) = 295a7a360a1a3765de37f8188ff1e358557e037c
-SHA1 (patch-ao) = 700af71348ac3236cd2a89f773e794905c97d1fa
+SHA1 (patch-an) = 488419f6322021d76615eca3f1f27e5d2b0cd4d3
+SHA1 (patch-ao) = 0a9fa8f1c0e0b11541a66141708b8f2fc74611fc
+SHA1 (patch-ap) = 417a5009c5a853eb0e4531faa733ebc33aa2e0a7
+SHA1 (patch-aq) = 7fbf63ea8342e54bbd0aaab59704decd6f8d842e
diff -r b95e4d1d705d -r 50fa9849a1bc net/rdist6/patches/patch-ai
--- a/net/rdist6/patches/patch-ai       Sat Jun 12 16:12:25 2010 +0000
+++ b/net/rdist6/patches/patch-ai       Sat Jun 12 19:36:00 2010 +0000
@@ -1,28 +1,85 @@
-$NetBSD: patch-ai,v 1.2 2010/03/07 08:52:27 lukem Exp $
+$NetBSD: patch-ai,v 1.3 2010/06/12 19:36:01 dholland Exp $
+
+Print and parse time_t as intmax_t, not as long (which might not fit).
+Likewise for (perhaps only some uses of) off_t.
+
+The last hunk is unrelated to the rest and fixes a tilde expansion bug.
 
 --- src/server.c.orig  1999-08-04 15:57:33.000000000 +0000
 +++ src/server.c
-@@ -684,7 +684,7 @@ static void query(xname)
+@@ -683,8 +683,8 @@ static void query(xname)
+       case S_IFIFO:
  #endif
  #endif
-               (void) sendcmd(QC_YES, "%ld %ld %o %s %s",
+-              (void) sendcmd(QC_YES, "%ld %ld %o %s %s",
 -                             (long) stb.st_size, stb.st_mtime,
-+                             (long) stb.st_size, (long)stb.st_mtime,
++              (void) sendcmd(QC_YES, "%jd %jd %o %s %s",
++                             (intmax_t)stb.st_size, (intmax_t)stb.st_mtime,
                               stb.st_mode & 07777,
                               getusername(stb.st_uid, target, options), 
                               getgroupname(stb.st_gid, target, options));
-@@ -1534,8 +1534,8 @@ static void recvit(cmd, type)
+@@ -1449,6 +1449,7 @@ static void recvit(cmd, type)
+       opt_t opts;
+       off_t size;
+       time_t mtime, atime;
++      intmax_t size_big, mtime_big, atime_big;
+       char *owner, *group, *file;
+       char new[MAXPATHLEN];
+       char fileb[MAXPATHLEN];
+@@ -1476,7 +1477,12 @@ static void recvit(cmd, type)
+       /*
+        * Get file size
+        */
+-      size = strtol(cp, &cp, 10);
++      size_big = strtoimax(cp, &cp, 10);
++      if ((intmax_t)(off_t)size_big != size_big) {
++              error("recvit: size out of range");
++              return;
++      }
++      size = (off_t)size_big;
+       if (*cp++ != ' ') {
+               error("recvit: size not delimited");
+               return;
+@@ -1485,7 +1491,12 @@ static void recvit(cmd, type)
+       /*
+        * Get modification time
+        */
+-      mtime = strtol(cp, &cp, 10);
++      mtime_big = strtoimax(cp, &cp, 10);
++      if ((intmax_t)(off_t)mtime_big != mtime_big) {
++              error("recvit: mtime out of range");
++              return;
++      }
++      mtime = (time_t)mtime_big;
+       if (*cp++ != ' ') {
+               error("recvit: mtime not delimited");
+               return;
+@@ -1494,7 +1505,12 @@ static void recvit(cmd, type)
+       /*
+        * Get access time
+        */
+-      atime = strtol(cp, &cp, 10);
++      atime_big = strtoimax(cp, &cp, 10);
++      if ((intmax_t)(off_t)atime_big != atime_big) {
++              error("recvit: atime out of range");
++              return;
++      }
++      atime = (time_t)atime_big;
+       if (*cp++ != ' ') {
+               error("recvit: atime not delimited");
+               return;
+@@ -1534,8 +1550,8 @@ static void recvit(cmd, type)
        file = fileb;
  
        debugmsg(DM_MISC,
 -               "recvit: opts = %04o mode = %04o size = %d mtime = %d",
 -               opts, mode, size, mtime);
-+               "recvit: opts = %04o mode = %04o size = %ld mtime = %ld",
-+               opts, mode, (long)size, (long)mtime);
++               "recvit: opts = %04o mode = %04o size = %jd mtime = %jd",
++               opts, mode, (intmax_t)size, (intmax_t)mtime);
        debugmsg(DM_MISC,
         "recvit: owner = '%s' group = '%s' file = '%s' catname = %d isdir = %d",
                 owner, group, file, catname, (type == S_IFDIR) ? 1 : 0);
-@@ -1737,7 +1737,7 @@ static void settarget(cmd, isdir)
+@@ -1737,7 +1753,7 @@ static void settarget(cmd, isdir)
        /*
         * Handle target
         */
diff -r b95e4d1d705d -r 50fa9849a1bc net/rdist6/patches/patch-an
--- a/net/rdist6/patches/patch-an       Sat Jun 12 16:12:25 2010 +0000
+++ b/net/rdist6/patches/patch-an       Sat Jun 12 19:36:00 2010 +0000
@@ -1,33 +1,102 @@
-$NetBSD: patch-an,v 1.1 2010/03/07 08:52:27 lukem Exp $
+$NetBSD: patch-an,v 1.2 2010/06/12 19:36:01 dholland Exp $
+
+Print and parse time_t as intmax_t, not as long (which might not fit).
+Likewise for (perhaps only some uses of) off_t.
 
 --- src/client.c.orig  1999-11-01 00:22:14.000000000 +0000
 +++ src/client.c
-@@ -435,7 +435,7 @@ static int sendfile(rname, opts, stb, us
+@@ -433,9 +433,9 @@ static int sendfile(rname, opts, stb, us
+               debugmsg(DM_MISC, "Turning off compression");
+       }
  
-       (void) sendcmd(C_RECVREG, "%o %04o %ld %ld %ld %s %s %s", 
-                      opts, stb->st_mode & 07777, (long) stb->st_size, 
+-      (void) sendcmd(C_RECVREG, "%o %04o %ld %ld %ld %s %s %s", 
+-                     opts, stb->st_mode & 07777, (long) stb->st_size, 
 -                     stb->st_mtime, stb->st_atime,
-+                     (long)stb->st_mtime, (long)stb->st_atime,
++      (void) sendcmd(C_RECVREG, "%o %04o %jd %jd %jd %s %s %s", 
++                     opts, stb->st_mode & 07777, (intmax_t) stb->st_size, 
++                     (intmax_t)stb->st_mtime, (intmax_t)stb->st_atime,
                       user, group, ername);
        if (response() < 0) {
                (void) close(f);
-@@ -734,7 +734,7 @@ static int sendlink(rname, opts, stb, us
+@@ -450,8 +450,8 @@ static int sendfile(rname, opts, stb, us
+               }
+       }
+ 
+-      debugmsg(DM_MISC, "Send file '%s' %ld bytes%s\n", rname,
+-               (long) stb->st_size, rem_wz ? " (compressing)" : "");
++      debugmsg(DM_MISC, "Send file '%s' %jd bytes%s\n", rname,
++               (intmax_t) stb->st_size, rem_wz ? " (compressing)" : "");
+ 
+       /*
+        * Set remote time out alarm handler.
+@@ -732,9 +732,9 @@ static int sendlink(rname, opts, stb, us
+        * Gather and send basic link info
+        */
        ENCODE(ername, rname);
-       (void) sendcmd(C_RECVSYMLINK, "%o %04o %ld %ld %ld %s %s %s", 
-                      opts, stb->st_mode & 07777, (long) stb->st_size, 
+-      (void) sendcmd(C_RECVSYMLINK, "%o %04o %ld %ld %ld %s %s %s", 
+-                     opts, stb->st_mode & 07777, (long) stb->st_size, 
 -                     stb->st_mtime, stb->st_atime,
-+                     (long)stb->st_mtime, (long)stb->st_atime,
++      (void) sendcmd(C_RECVSYMLINK, "%o %04o %jd %jd %jd %s %s %s", 
++                     opts, stb->st_mode & 07777, (intmax_t) stb->st_size, 
++                     (intmax_t)stb->st_mtime, (intmax_t)stb->st_atime,
                       user, group, ername);
        if (response() < 0)
                return(-1);
-@@ -973,8 +973,8 @@ static int update(rname, opts, statp)
+@@ -833,6 +833,7 @@ static int update(rname, opts, statp)
+ {
+       off_t size;
+       time_t mtime;
++      intmax_t size_big, mtime_big;
+       unsigned short lmode;
+       unsigned short rmode;
+       char *owner = NULL, *group = NULL;
+@@ -921,7 +922,12 @@ static int update(rname, opts, statp)
+       /*
+        * Parse size
+        */
+-      size = (off_t) strtol(cp, (char **)&cp, 10);
++      size_big = strtoimax(cp, (char **)&cp, 10);
++      if ((intmax_t)(off_t)size_big != size_big) {
++              error("update: size out of range");
++              return(US_NOTHING);
++      }
++      size = (off_t)size_big;
+       if (*cp++ != ' ') {
+               error("update: size not delimited");
+               return(US_NOTHING);
+@@ -930,7 +936,12 @@ static int update(rname, opts, statp)
+       /*
+        * Parse mtime
+        */
+-      mtime = strtol(cp, (char **)&cp, 10);
++      mtime_big = strtoimax(cp, (char **)&cp, 10);
++      if ((intmax_t)(off_t)mtime_big != mtime_big) {
++              error("update: mtime out of range");
++              return(US_NOTHING);
++      }
++      mtime = (time_t)mtime_big;
+       if (*cp++ != ' ') {
+               error("update: mtime not delimited");
+               return(US_NOTHING);
+@@ -973,8 +984,8 @@ static int update(rname, opts, statp)
  
        debugmsg(DM_MISC, "update(%s,) local mode %04o remote mode %04o\n", 
                 rname, lmode, rmode);
 -      debugmsg(DM_MISC, "update(%s,) size %ld mtime %d owner '%s' grp '%s'\n",
 -               rname, (long) size, mtime, owner, group);
-+      debugmsg(DM_MISC, "update(%s,) size %ld mtime %ld owner '%s' grp '%s'\n",
-+               rname, (long) size, (long)mtime, owner, group);
++      debugmsg(DM_MISC, "update(%s,) size %jd mtime %jd owner '%s' grp '%s'\n",
++               rname, (intmax_t)size, (intmax_t)mtime, owner, group);
  
        if (statp->st_mtime != mtime) {
                if (statp->st_mtime < mtime && IS_ON(opts, DO_YOUNGER)) {
+@@ -987,8 +998,8 @@ static int update(rname, opts, statp)
+       }
+ 
+       if (statp->st_size != size) {
+-              debugmsg(DM_MISC, "size does not match (%ld != %ld).\n",
+-                       (long) statp->st_size, (long) size);
++              debugmsg(DM_MISC, "size does not match (%jd != %jd).\n",
++                       (intmax_t)statp->st_size, (intmax_t)size);
+               return(US_OUTDATE);
+       } 
+ 
diff -r b95e4d1d705d -r 50fa9849a1bc net/rdist6/patches/patch-ao
--- a/net/rdist6/patches/patch-ao       Sat Jun 12 16:12:25 2010 +0000
+++ b/net/rdist6/patches/patch-ao       Sat Jun 12 19:36:00 2010 +0000
@@ -1,4 +1,6 @@
-$NetBSD: patch-ao,v 1.1 2010/03/07 08:52:27 lukem Exp $
+$NetBSD: patch-ao,v 1.2 2010/06/12 19:36:01 dholland Exp $
+
+Print and parse time_t as intmax_t, not as long (which might not fit).
 
 --- src/docmd.c.orig   2001-03-12 18:42:23.000000000 +0000
 +++ src/docmd.c
@@ -7,7 +9,7 @@
        }
  
 -      debugmsg(DM_MISC, "%s: mtime %d\n", stamp, stb.st_mtime);
-+      debugmsg(DM_MISC, "%s: mtime %ld\n", stamp, (long) stb.st_mtime);
++      debugmsg(DM_MISC, "%s: mtime %jd\n", stamp, (intmax_t)stb.st_mtime);
  
        env = NULL;
        for (sc = sbcmds; sc != NULL; sc = sc->sc_next) {
diff -r b95e4d1d705d -r 50fa9849a1bc net/rdist6/patches/patch-ap
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/rdist6/patches/patch-ap       Sat Jun 12 19:36:00 2010 +0000
@@ -0,0 +1,14 @@
+$NetBSD: patch-ap,v 1.1 2010/06/12 19:36:01 dholland Exp $
+
+Need inttypes.h for strtoimax for handling time_t safely.
+
+--- include/defs.h.orig        2001-03-12 18:16:30.000000000 +0000
++++ include/defs.h
+@@ -42,6 +42,7 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
++#include <inttypes.h>
+ #include <ctype.h>
+ #include <errno.h>
+ #include <pwd.h>
diff -r b95e4d1d705d -r 50fa9849a1bc net/rdist6/patches/patch-aq
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/rdist6/patches/patch-aq       Sat Jun 12 19:36:00 2010 +0000
@@ -0,0 +1,16 @@
+$NetBSD: patch-aq,v 1.1 2010/06/12 19:36:01 dholland Exp $
+
+Use NULL, not 0, to terminate execl() args. Otherwise (e.g. on LP64)
+you might not get a pointer-sized zero value.



Home | Main Index | Thread Index | Old Index