summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authordholland <dholland@pkgsrc.org>2010-06-12 19:36:00 +0000
committerdholland <dholland@pkgsrc.org>2010-06-12 19:36:00 +0000
commit4fc1755c8819390374c27431b623dcba17933374 (patch)
treeb52f18315a0ef7858f7be2b02154f26ddf93382a /net
parentfee9a8c02787d295e2d5a2e29964874221776d2c (diff)
downloadpkgsrc-4fc1755c8819390374c27431b623dcba17933374.tar.gz
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 (limited to 'net')
-rw-r--r--net/rdist6/Makefile4
-rw-r--r--net/rdist6/distinfo10
-rw-r--r--net/rdist6/patches/patch-ai73
-rw-r--r--net/rdist6/patches/patch-an93
-rw-r--r--net/rdist6/patches/patch-ao6
-rw-r--r--net/rdist6/patches/patch-ap14
-rw-r--r--net/rdist6/patches/patch-aq16
7 files changed, 188 insertions, 28 deletions
diff --git a/net/rdist6/Makefile b/net/rdist6/Makefile
index 32cf5b6f45b..cb87860f99e 100644
--- a/net/rdist6/Makefile
+++ b/net/rdist6/Makefile
@@ -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 --git a/net/rdist6/distinfo b/net/rdist6/distinfo
index ca4d36825aa..9ec606efb2b 100644
--- a/net/rdist6/distinfo
+++ b/net/rdist6/distinfo
@@ -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-ae) = 2bcbce70c6228b34c13082e6a2b82f67f02389f8
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 --git a/net/rdist6/patches/patch-ai b/net/rdist6/patches/patch-ai
index 5a88af14627..e8c799f5450 100644
--- a/net/rdist6/patches/patch-ai
+++ b/net/rdist6/patches/patch-ai
@@ -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 --git a/net/rdist6/patches/patch-an b/net/rdist6/patches/patch-an
index 5812af74ba6..0b5920894a2 100644
--- a/net/rdist6/patches/patch-an
+++ b/net/rdist6/patches/patch-an
@@ -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 --git a/net/rdist6/patches/patch-ao b/net/rdist6/patches/patch-ao
index 8f0c9321563..835f638dae2 100644
--- a/net/rdist6/patches/patch-ao
+++ b/net/rdist6/patches/patch-ao
@@ -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 @@ $NetBSD: patch-ao,v 1.1 2010/03/07 08:52:27 lukem Exp $
}
- 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 --git a/net/rdist6/patches/patch-ap b/net/rdist6/patches/patch-ap
new file mode 100644
index 00000000000..0a29458eb1b
--- /dev/null
+++ b/net/rdist6/patches/patch-ap
@@ -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 --git a/net/rdist6/patches/patch-aq b/net/rdist6/patches/patch-aq
new file mode 100644
index 00000000000..160a0d1e429
--- /dev/null
+++ b/net/rdist6/patches/patch-aq
@@ -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.
+
+--- src/common.c.orig 2001-03-12 18:16:36.000000000 +0000
++++ src/common.c
+@@ -859,7 +859,7 @@ void runcommand(cmd)
+ (void) dup(fd[PIPE_WRITE]);
+ (void) close(fd[PIPE_READ]);
+ (void) close(fd[PIPE_WRITE]);
+- (void) execl(_PATH_BSHELL, "sh", "-c", cmd, 0);
++ (void) execl(_PATH_BSHELL, "sh", "-c", cmd, NULL);
+ _exit(127);
+ }
+ (void) close(fd[PIPE_WRITE]);