1
|
1 |
diff -urN procmail-3.22/src/cstdio.c procmail-3.22-hacked/src/cstdio.c
|
|
2 |
--- procmail-3.22/src/cstdio.c 2000-12-31 19:08:20.000000000 +1300
|
|
3 |
+++ procmail-3.22-hacked/src/cstdio.c 2005-10-21 13:22:42.484383152 +1300
|
|
4 |
@@ -266,7 +266,7 @@
|
|
5 |
}
|
|
6 |
|
|
7 |
/* read a bunch of characters from the LMTP input stream */
|
|
8 |
-int readL(p,len)char*p;const int len;
|
|
9 |
+int readL(p,len)char*p;const size_t len;
|
|
10 |
{ size_t min;
|
|
11 |
if(rcbufp==rcbufend)
|
|
12 |
refillL();
|
|
13 |
@@ -282,8 +282,8 @@
|
|
14 |
* read exactly len bytes from the LMTP input stream
|
|
15 |
* return 1 on success, 0 on EOF, and -1 on read error
|
|
16 |
*/
|
|
17 |
-int readLe(p,len)char*p;int len;
|
|
18 |
-{ long got=rcbufend-rcbufp;
|
|
19 |
+int readLe(p,len)char*p;size_t len;
|
|
20 |
+{ off_t got = rcbufend-rcbufp;
|
|
21 |
if(got>0) /* first, copy from the buffer */
|
|
22 |
{ if(got>len) /* is that more than we need? */
|
|
23 |
got=len;
|
|
24 |
diff -urN procmail-3.22/src/cstdio.h procmail-3.22-hacked/src/cstdio.h
|
|
25 |
--- procmail-3.22/src/cstdio.h 2000-12-31 19:08:21.000000000 +1300
|
|
26 |
+++ procmail-3.22-hacked/src/cstdio.h 2005-10-21 13:22:42.476384368 +1300
|
|
27 |
@@ -26,6 +26,6 @@
|
|
28 |
int
|
|
29 |
endoread P((void)),
|
|
30 |
getL P((void)),
|
|
31 |
- readL P((char*,const int)),
|
|
32 |
- readLe P((char*,int));
|
|
33 |
+ readL P((char*,const size_t)),
|
|
34 |
+ readLe P((char*,size_t));
|
|
35 |
#endif
|
|
36 |
diff -urN procmail-3.22/src/formail.c procmail-3.22-hacked/src/formail.c
|
|
37 |
--- procmail-3.22/src/formail.c 2005-10-21 13:22:14.140692048 +1300
|
|
38 |
+++ procmail-3.22-hacked/src/formail.c 2005-10-21 13:22:42.509379352 +1300
|
|
39 |
@@ -304,7 +304,7 @@
|
|
40 |
}
|
|
41 |
/* lifted out of main() to reduce main()'s size */
|
|
42 |
static void elimdups(namep,idcache,maxlen,split)const char*const namep;
|
|
43 |
- FILE*idcache;const long maxlen;const int split;
|
|
44 |
+ FILE*idcache;const off_t maxlen;const int split;
|
|
45 |
{ int dupid=0;char*key,*oldnewl;
|
|
46 |
key=(char*)namep; /* not to worry, no change will be noticed */
|
|
47 |
if(!areply)
|
|
48 |
@@ -313,7 +313,7 @@
|
|
49 |
*(oldnewl=(key=msid->rexp)+msid->rexl-1)='\0';
|
|
50 |
} /* wipe out trailing newline */
|
|
51 |
if(key)
|
|
52 |
- { long insoffs=maxlen;
|
|
53 |
+ { off_t insoffs=maxlen;
|
|
54 |
while(*key==' ') /* strip leading spaces */
|
|
55 |
key++;
|
|
56 |
do
|
|
57 |
@@ -350,7 +350,7 @@
|
|
58 |
fseek(idcache,insoffs,SEEK_SET);fwrite(key,1,strlen(key)+1,idcache);
|
|
59 |
putc('\0',idcache); /* mark new end of buffer */
|
|
60 |
dupfound:
|
|
61 |
- fseek(idcache,(long)0,SEEK_SET); /* rewind, for any next run */
|
|
62 |
+ fseek(idcache,(off_t)0,SEEK_SET); /* rewind, for any next run */
|
|
63 |
if(!areply)
|
|
64 |
*oldnewl='\n'; /* restore the newline */
|
|
65 |
}
|
|
66 |
@@ -366,7 +366,7 @@
|
|
67 |
{ int i,split=0,force=0,bogus=1,every=0,headreply=0,digest=0,nowait=0,keepb=0,
|
|
68 |
minfields=(char*)progid-(char*)progid,conctenate=0,babyl=0,babylstart,
|
|
69 |
berkeley=0,forgetclen;
|
|
70 |
- long maxlen,ctlength;FILE*idcache=0;pid_t thepid;
|
|
71 |
+ off_t maxlen,ctlength;FILE*idcache=0;pid_t thepid;
|
|
72 |
size_t j,lnl,escaplen;char*chp,*namep,*escap=ESCAP;
|
|
73 |
struct field*fldp,*fp2,**afldp,*fdate,*fcntlength,*fsubject,*fFrom_;
|
|
74 |
if(lastm) /* sanity check, any argument at all? */
|
|
75 |
diff -urN procmail-3.22/src/lmtp.c procmail-3.22-hacked/src/lmtp.c
|
|
76 |
--- procmail-3.22/src/lmtp.c 2001-06-29 14:20:51.000000000 +1200
|
|
77 |
+++ procmail-3.22-hacked/src/lmtp.c 2005-10-21 13:22:42.516378288 +1300
|
|
78 |
@@ -72,8 +72,8 @@
|
|
79 |
protobad[]="503 5.5.1 command unexpected\r\n";
|
|
80 |
|
|
81 |
static void bufwrite(buffer,len,flush)
|
|
82 |
-const char*buffer;int len;int flush;
|
|
83 |
-{ int already;
|
|
84 |
+const char*buffer;size_t len;int flush;
|
|
85 |
+{ size_t already;
|
|
86 |
if((already=bufcur-buf2)+len>linebuf||flush)
|
|
87 |
{ if(already&&already!=rwrite(savstdout,bufcur=buf2,already)||
|
|
88 |
len&&len!=rwrite(savstdout,buffer,len))
|
|
89 |
diff -urN procmail-3.22/src/lockfile.c procmail-3.22-hacked/src/lockfile.c
|
|
90 |
--- procmail-3.22/src/lockfile.c 2001-09-11 16:58:04.000000000 +1200
|
|
91 |
+++ procmail-3.22-hacked/src/lockfile.c 2005-10-21 13:22:42.478384064 +1300
|
|
92 |
@@ -263,7 +263,7 @@
|
|
93 |
{ return open(name,mode,mask); /* stub */
|
|
94 |
}
|
|
95 |
|
|
96 |
-int rwrite(fd,a,len)const int fd;const void*const a;const int len; /* stub */
|
|
97 |
+int rwrite(fd,a,len)const int fd;const void*const a;const size_t len; /* stub */
|
|
98 |
{ return write(fd,a,len);
|
|
99 |
}
|
|
100 |
|
|
101 |
diff -urN procmail-3.22/src/mailfold.c procmail-3.22-hacked/src/mailfold.c
|
|
102 |
--- procmail-3.22/src/mailfold.c 2005-10-21 13:22:14.227678824 +1300
|
|
103 |
+++ procmail-3.22-hacked/src/mailfold.c 2005-10-21 13:22:42.527376616 +1300
|
|
104 |
@@ -30,7 +30,7 @@
|
|
105 |
|
|
106 |
int logopened,rawnonl;
|
|
107 |
off_t lasttell;
|
|
108 |
-static long lastdump;
|
|
109 |
+static off_t lastdump;
|
|
110 |
static volatile int mailread; /* if the mail is completely read in already */
|
|
111 |
static struct dyna_array confield; /* escapes, concatenations */
|
|
112 |
static const char*realstart,*restbody;
|
|
113 |
@@ -78,8 +78,8 @@
|
|
114 |
#endif /* eMAILBOX_SEPARATOR */
|
|
115 |
|
|
116 |
long dump(s,type,source,len)const int s,type;const char*source;
|
|
117 |
- long len;
|
|
118 |
-{ int i;long part;
|
|
119 |
+ size_t len;
|
|
120 |
+{ int i;size_t part;
|
|
121 |
lasttell=i= -1;SETerrno(EBADF);
|
|
122 |
if(s>=0)
|
|
123 |
{ if(ft_lock(type)&&(lseek(s,(off_t)0,SEEK_END),fdlock(s)))
|
|
124 |
@@ -105,7 +105,7 @@
|
|
125 |
goto jin;
|
|
126 |
do
|
|
127 |
{ part=getchunk(s,source,len);
|
|
128 |
-jin: while(part&&(i=rwrite(s,source,BLKSIZ<part?BLKSIZ:(int)part)))
|
|
129 |
+jin: while(part&&(i=rwrite(s,source, BLKSIZ < part ? BLKSIZ : (size_t)part )))
|
|
130 |
{ if(i<0)
|
|
131 |
goto writefin;
|
|
132 |
part-=i;len-=i;source+=i;
|
|
133 |
diff -urN procmail-3.22/src/mailfold.h procmail-3.22-hacked/src/mailfold.h
|
|
134 |
--- procmail-3.22/src/mailfold.h 2000-12-31 19:08:34.000000000 +1300
|
|
135 |
+++ procmail-3.22-hacked/src/mailfold.h 2005-10-21 13:22:42.510379200 +1300
|
|
136 |
@@ -1,7 +1,7 @@
|
218
|
137 |
/*$Id: mailfold.h,v 1.24 2000/10/25 08:13:20 guenther Exp $*/
|
1
|
138 |
|
|
139 |
long
|
|
140 |
- dump P((const int s,const int type,const char*source,long len));
|
|
141 |
+ dump P((const int s,const int type,const char*source,size_t len));
|
|
142 |
int
|
|
143 |
writefolder P((char*boxname,char*linkfolder,const char*source,long len,
|
|
144 |
const int ignwerr,const int dolock));
|
|
145 |
diff -urN procmail-3.22/src/memblk.c procmail-3.22-hacked/src/memblk.c
|
|
146 |
--- procmail-3.22/src/memblk.c 2005-10-21 13:22:14.141691896 +1300
|
|
147 |
+++ procmail-3.22-hacked/src/memblk.c 2005-10-21 13:22:42.535375400 +1300
|
|
148 |
@@ -29,7 +29,7 @@
|
|
149 |
#define set_fd(mb,num) do{}while(0)
|
|
150 |
#endif
|
|
151 |
|
|
152 |
-void makeblock(mb,len)memblk*const mb;const long len;
|
|
153 |
+void makeblock(mb,len)memblk*const mb;const off_t len;
|
|
154 |
{ mb->len=0;mb->p=malloc(1);set_fd(mb,-1);
|
|
155 |
if(len)
|
|
156 |
resizeblock(mb,len,0);
|
|
157 |
@@ -51,7 +51,7 @@
|
|
158 |
{
|
|
159 |
#ifdef USE_MMAP
|
|
160 |
if(mb->fd>=0)
|
|
161 |
- { long mlen=mb->len+1;
|
|
162 |
+ { off_t mlen=mb->len+1;
|
|
163 |
if(munmap(mb->p,mlen))
|
|
164 |
mmapfailed(mlen); /* don't want to continue here */
|
|
165 |
if((mb->p=mmap(0,mlen,PROT_READ,MAP_PRIVATE,mb->fd,(off_t)0))==MAP_FAILED)
|
|
166 |
@@ -62,7 +62,7 @@
|
|
167 |
#endif
|
|
168 |
}
|
|
169 |
|
|
170 |
-int resizeblock(mb,len,nonfatal)memblk*const mb;const long len;
|
|
171 |
+int resizeblock(mb,len,nonfatal)memblk*const mb;const off_t len;
|
|
172 |
const int nonfatal;
|
|
173 |
{ if(len==mb->len)
|
|
174 |
goto ret1;
|
|
175 |
@@ -134,7 +134,7 @@
|
|
176 |
read_func_type*read_func;cleanup_func_type*cleanup_func;
|
|
177 |
long*const filledp;void*data;
|
|
178 |
{ int blksiz=BLKSIZ,ok;unsigned int shift=EXPBLKSIZ;
|
|
179 |
- long filled= *filledp,origfilled=filled;
|
|
180 |
+ size_t filled= *filledp,origfilled=filled;
|
|
181 |
if(filled<mb->len) /* skip the initial resize if we have space */
|
|
182 |
goto jumpin;
|
|
183 |
for(;;)
|
|
184 |
@@ -160,7 +160,7 @@
|
|
185 |
blksiz=newbs; /* yes, take me! */
|
|
186 |
}
|
|
187 |
}
|
|
188 |
- if(cleanup_func&&(*cleanup_func)(mb,&filled,origfilled,data))
|
|
189 |
+ if(cleanup_func&&(*cleanup_func)(mb,(long*)&filled,origfilled,data))
|
|
190 |
goto jumpin;
|
|
191 |
resizeblock(mb,filled+1,1); /* minimise+1 for housekeeping */
|
|
192 |
*filledp=filled; /* write back the new value */
|
|
193 |
diff -urN procmail-3.22/src/memblk.h procmail-3.22-hacked/src/memblk.h
|
|
194 |
--- procmail-3.22/src/memblk.h 2005-10-21 13:22:14.194683840 +1300
|
|
195 |
+++ procmail-3.22-hacked/src/memblk.h 2005-10-21 13:22:42.473384824 +1300
|
|
196 |
@@ -1,6 +1,6 @@
|
|
197 |
typedef struct memblk {
|
|
198 |
char*p; /* where it starts */
|
|
199 |
- long len; /* current size, not including trailing NUL */
|
|
200 |
+ off_t len; /* current size, not including trailing NUL */
|
|
201 |
#ifdef USE_MMAP
|
|
202 |
off_t filelen; /* how long is the file */
|
|
203 |
int fd; /* file which is mmap()ed */
|
|
204 |
@@ -11,11 +11,11 @@
|
|
205 |
typedef int(cleanup_func_type) P((memblk*,long*,long,void*));
|
|
206 |
|
|
207 |
void
|
|
208 |
- makeblock P((memblk*const,const long)), /* create block of the given length */
|
|
209 |
+ makeblock P((memblk*const,const off_t)), /* create block of the given length */
|
|
210 |
freeblock P((memblk*const)), /* deallocate it */
|
|
211 |
lockblock P((memblk*const)); /* protect this block from future changes */
|
|
212 |
int /* by this process */
|
|
213 |
- resizeblock P((memblk*const,const long,const int)); /* change the size */
|
|
214 |
+ resizeblock P((memblk*const,const off_t,const int)); /* change the size */
|
|
215 |
char /* dynamically grow a block to fit data as it comes in */
|
|
216 |
*read2blk P((memblk*const,long*const,read_func_type*,cleanup_func_type*,void*));
|
|
217 |
|
|
218 |
diff -urN procmail-3.22/src/pipes.c procmail-3.22-hacked/src/pipes.c
|
|
219 |
--- procmail-3.22/src/pipes.c 2005-10-21 13:22:14.185685208 +1300
|
|
220 |
+++ procmail-3.22-hacked/src/pipes.c 2005-10-21 13:22:42.522377376 +1300
|
|
221 |
@@ -262,7 +262,7 @@
|
|
222 |
return len;
|
|
223 |
}
|
|
224 |
|
|
225 |
-static char*read_read(p,left,data)char*p;long left;void*data;
|
|
226 |
+static char*read_read(p,left,data)char*p; size_t left;void*data;
|
|
227 |
{ long got;
|
|
228 |
do
|
|
229 |
if(0>=(got=rread(STDIN,p,left))) /* read mail */
|
|
230 |
@@ -311,7 +311,7 @@
|
|
231 |
rclose(PWRI);p=dest;
|
|
232 |
if(!forkerr(pidchild,name))
|
|
233 |
{ name=tstrdup(name);
|
|
234 |
- while(0<(i=rread(PRDI,p,(int)max))&&(p+=i,max-=i)); /* read its lips */
|
|
235 |
+ while(0<(i=rread(PRDI,p,max))&&(p+=i,max-=i)); /* read its lips */
|
|
236 |
if(0<rread(PRDI,p,1))
|
|
237 |
{ nlog("Excessive output quenched from");logqnl(name);
|
|
238 |
setoverflow();
|
|
239 |
diff -urN procmail-3.22/src/robust.c procmail-3.22-hacked/src/robust.c
|
|
240 |
--- procmail-3.22/src/robust.c 2001-06-29 14:21:11.000000000 +1200
|
|
241 |
+++ procmail-3.22-hacked/src/robust.c 2005-10-21 13:22:42.481383608 +1300
|
|
242 |
@@ -165,13 +165,13 @@
|
|
243 |
return i;
|
|
244 |
}
|
|
245 |
|
|
246 |
-int rread(fd,a,len)const int fd,len;void*const a; /* a SysV secure read */
|
|
247 |
+int rread(fd,a,len)const int fd; const size_t len; void*const a; /* a SysV secure read */
|
|
248 |
{ int i;
|
|
249 |
while(0>(i=read(fd,a,(size_t)len))&&errno==EINTR);
|
|
250 |
return i;
|
|
251 |
}
|
|
252 |
/* a SysV secure write */
|
|
253 |
-int rwrite(fd,a,len)const int fd,len;const void*const a;
|
|
254 |
+int rwrite(fd,a,len)const int fd; const size_t len;const void*const a;
|
|
255 |
{ int i;
|
|
256 |
while(0>(i=write(fd,a,(size_t)len))&&errno==EINTR);
|
|
257 |
return i;
|
|
258 |
diff -urN procmail-3.22/src/robust.h procmail-3.22-hacked/src/robust.h
|
|
259 |
--- procmail-3.22/src/robust.h 2001-06-29 14:21:11.000000000 +1200
|
|
260 |
+++ procmail-3.22-hacked/src/robust.h 2005-10-21 13:22:42.533375704 +1300
|
|
261 |
@@ -18,7 +18,7 @@
|
|
262 |
rpipe P((int fd[2])),
|
|
263 |
rdup P((const int p)),
|
|
264 |
rclose P((const int fd)),
|
|
265 |
- rread P((const int fd,void*const a,const int len)),
|
|
266 |
- rwrite P((const int fd,const void*const a,const int len));
|
|
267 |
+ rread P((const int fd,void*const a,const size_t len)),
|
|
268 |
+ rwrite P((const int fd,const void*const a,const size_t len));
|
|
269 |
|
|
270 |
extern mode_t cumask;
|