1Upstream-Status: Inappropriate [1]
2
3[1] Not the author, the patch is from:
4http://vault.centos.org/5.8/os/SRPMS/rdist-6.1.5-44.src.rpm
5
6--- rdist-6.1.5/src/client.c.lfs	2003-12-16 23:43:56.000000000 +0100
7+++ rdist-6.1.5/src/client.c	2003-12-16 23:46:56.000000000 +0100
8@@ -414,9 +414,9 @@
9 	/*
10 	 * Send file info
11 	 */
12-	(void) sendcmd(C_RECVREG, "%o %04o %ld %ld %ld %s %s %s",
13+	(void) sendcmd(C_RECVREG, "%o %04o %lld %ld %ld %s %s %s",
14 		       opts, stb->st_mode & 07777,
15-		       (long) stb->st_size,
16+		       (off_t) stb->st_size,
17 		       stb->st_mtime, stb->st_atime,
18 		       user, group, rname);
19 	if (response() < 0) {
20@@ -424,8 +424,8 @@
21 		return(-1);
22 	}
23
24-	debugmsg(DM_MISC, "Send file '%s' %d bytes\n",
25-		 rname, (long) stb->st_size);
26+	debugmsg(DM_MISC, "Send file '%s' %lld bytes\n",
27+		 rname, (off_t) stb->st_size);
28
29 	/*
30 	 * Set remote time out alarm handler.
31@@ -676,9 +676,9 @@
32 	/*
33 	 * Gather and send basic link info
34 	 */
35-	(void) sendcmd(C_RECVSYMLINK, "%o %04o %ld %ld %ld %s %s %s",
36+	(void) sendcmd(C_RECVSYMLINK, "%o %04o %lld %ld %ld %s %s %s",
37 		       opts, stb->st_mode & 07777,
38-		       (long) stb->st_size,
39+		       (off_t) stb->st_size,
40 		       stb->st_mtime, stb->st_atime,
41 		       user, group, rname);
42 	if (response() < 0)
43@@ -858,7 +858,7 @@
44 	/*
45 	 * Parse size
46 	 */
47-	size = strtol(cp, &cp, 10);
48+	size = strtoll(cp, &cp, 10);
49 	if (*cp++ != ' ') {
50 		error("update: size not delimited");
51 		return(US_NOTHING);
52@@ -910,8 +910,8 @@
53
54 	debugmsg(DM_MISC, "update(%s,) local mode %04o remote mode %04o\n",
55 		 rname, lmode, rmode);
56-	debugmsg(DM_MISC, "update(%s,) size %d mtime %d owner '%s' grp '%s'\n",
57-		 rname, (int) size, mtime, owner, group);
58+	debugmsg(DM_MISC, "update(%s,) size %lld mtime %d owner '%s' grp '%s'\n",
59+		 rname, (off_t) size, mtime, owner, group);
60
61 	if (statp->st_mtime != mtime) {
62 		if (statp->st_mtime < mtime && IS_ON(opts, DO_YOUNGER)) {
63@@ -937,8 +937,8 @@
64 	}
65
66 	if (statp->st_size != size) {
67-		debugmsg(DM_MISC, "size does not match (%d != %d).\n",
68-			 (int) statp->st_size, size);
69+		debugmsg(DM_MISC, "size does not match (%lld != %lld).\n",
70+			 statp->st_size, size);
71 		return(US_OUTDATE);
72 	}
73
74--- rdist-6.1.5/src/server.c.lfs	1998-11-10 05:15:31.000000000 +0100
75+++ rdist-6.1.5/src/server.c	2003-12-16 23:50:19.000000000 +0100
76@@ -645,8 +645,8 @@
77 	case S_IFLNK:
78 	case S_IFDIR:
79 	case S_IFREG:
80-		(void) sendcmd(QC_YES, "%ld %ld %o %s %s",
81-			       (long) stb.st_size,
82+		(void) sendcmd(QC_YES, "%lld %ld %o %s %s",
83+			       (off_t) stb.st_size,
84 			       stb.st_mtime,
85 			       stb.st_mode & 07777,
86 			       getusername(stb.st_uid, target, options),
87@@ -1388,7 +1388,7 @@
88 	/*
89 	 * Get file size
90 	 */
91-	size = strtol(cp, &cp, 10);
92+	size = strtoll(cp, &cp, 10);
93 	if (*cp++ != ' ') {
94 		error("recvit: size not delimited");
95 		return;
96@@ -1441,7 +1441,7 @@
97 	}
98
99 	debugmsg(DM_MISC,
100-		 "recvit: opts = %04o mode = %04o size = %d mtime = %d",
101+		 "recvit: opts = %04o mode = %04o size = %lld mtime = %d",
102 		 opts, mode, size, mtime);
103 	debugmsg(DM_MISC,
104        "recvit: owner = '%s' group = '%s' file = '%s' catname = %d isdir = %d",
105--- rdist-6.1.5/include/defs.h.lfs	2003-12-16 23:43:56.000000000 +0100
106+++ rdist-6.1.5/include/defs.h	2003-12-16 23:43:56.000000000 +0100
107@@ -22,6 +22,8 @@
108 #include <stdlib.h>
109 #endif	/* _POSIX_SOURCE */
110 #include <stdio.h>
111+#include <string.h>
112+#include <mntent.h>
113 #include <ctype.h>
114 #include <errno.h>
115 #include <pwd.h>
116@@ -317,15 +319,6 @@
117 #endif /* USE_STATDB */
118
119 /*
120- * System function declarations
121- */
122-char 			       *hasmntopt();
123-char			       *strchr();
124-char		 	       *strdup();
125-char		 	       *strrchr();
126-char 			       *strtok();
127-
128-/*
129  * Our own declarations.
130  */
131 char			       *exptilde();
132--- rdist-6.1.5/Makefile.local.lfs	1998-11-10 04:36:31.000000000 +0100
133+++ rdist-6.1.5/Makefile.local	2003-12-16 23:43:56.000000000 +0100
134@@ -20,7 +20,7 @@
135 # Add any local definitions you want pass to the compiler to DEFS_LOCAL
136 # below.  This includes those items found in "config/config.h".
137 #
138-#DEFS_LOCAL	= -DDIRECT_RCMD
139+DEFS_LOCAL	= -O2 -g -pipe -Wall -D_POSIX_SOURCE -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
140
141 #
142 # Add any local libraries that your system might need to LIBS_LOCAL below.
143