|
Removed
Link Here
|
| 1 |
From 87626c2707cc0d82e49e160ab3c85430ff33534f Mon Sep 17 00:00:00 2001 |
| 2 |
From: Matthias Andree <matthias.andree@gmx.de> |
| 3 |
Date: Sat, 24 Aug 2019 17:53:08 +0200 |
| 4 |
Subject: [PATCH] Properly report size of mailboxes of 2 GibiB or above. |
| 5 |
|
| 6 |
To fix Debian Bug#873668, reported by Andreas Schmidt. |
| 7 |
This requires C99's new long long type. |
| 8 |
--- |
| 9 |
NEWS | 7 +++++++ |
| 10 |
driver.c | 7 ++++--- |
| 11 |
etrn.c | 2 +- |
| 12 |
fetchmail.h | 2 +- |
| 13 |
imap.c | 2 +- |
| 14 |
odmr.c | 2 +- |
| 15 |
pop2.c | 2 +- |
| 16 |
pop3.c | 4 ++-- |
| 17 |
8 files changed, 18 insertions(+), 10 deletions(-) |
| 18 |
|
| 19 |
diff -up work/fetchmail-6.4.10/NEWS.orig work/fetchmail-6.4.10/NEWS |
| 20 |
--- a/NEWS |
| 21 |
+++ b/NEWS |
| 22 |
@@ -63,7 +63,13 @@ removed from a 6.5.0 or newer release.) |
| 23 |
* Fetchmail does not guarantee compatibility with EOL OpenSSL versions. Support |
| 24 |
for end-of-life OpenSSL versions may be removed even from patchlevel releases. |
| 25 |
|
| 26 |
---------------------------------------------------------------------------------- |
| 27 |
+-------------------------------------------------------------------------------- |
| 28 |
+## BUG FIXES |
| 29 |
+* fetchmail can now report mailbox sizes of 2^31 octets and beyond. |
| 30 |
+ This requires C99 support (for the long long type). |
| 31 |
+ Fixes Debian Bug#873668, reported by Andreas Schmidt. |
| 32 |
+ |
| 33 |
+-------------------------------------------------------------------------------- |
| 34 |
fetchmail-6.4.10 (released 2020-08-27, 27596 LoC): |
| 35 |
|
| 36 |
# REGRESSION FIX: |
| 37 |
diff --git a/driver.c b/driver.c |
| 38 |
index d21a32ab..a5033729 100644 |
| 39 |
--- a/driver.c |
| 40 |
+++ b/driver.c |
| 41 |
@@ -932,7 +932,7 @@ static int do_session( |
| 42 |
{ |
| 43 |
/* sigsetjmp returned zero -> normal operation */ |
| 44 |
char buf[MSGBUFSIZE+1], *realhost; |
| 45 |
- int count, newm, bytes; |
| 46 |
+ int count, newm; |
| 47 |
int fetches, dispatches, transient_errors, oldphase; |
| 48 |
struct idlist *idp; |
| 49 |
|
| 50 |
@@ -1306,6 +1306,7 @@ is restored.")); |
| 51 |
|
| 52 |
/* compute # of messages and number of new messages waiting */ |
| 53 |
stage = STAGE_GETRANGE; |
| 54 |
+ unsigned long long bytes; |
| 55 |
err = (ctl->server.base_protocol->getrange)(mailserver_socket, ctl, idp->id, &count, &newm, &bytes); |
| 56 |
if (err != 0) |
| 57 |
goto cleanUp; |
| 58 |
@@ -1335,10 +1336,10 @@ is restored.")); |
| 59 |
"%d messages for %s", |
| 60 |
count), |
| 61 |
count, buf); |
| 62 |
- if (bytes == -1) |
| 63 |
+ if (bytes == (unsigned long long)-1) // mailbox size unsupported |
| 64 |
report_complete(stdout, ".\n"); |
| 65 |
else |
| 66 |
- report_complete(stdout, GT_(" (%d octets).\n"), bytes); |
| 67 |
+ report_complete(stdout, GT_(" (%llu octets).\n"), bytes); |
| 68 |
} |
| 69 |
else |
| 70 |
{ |
| 71 |
diff --git a/etrn.c b/etrn.c |
| 72 |
index f3fab0ce..12b9d3fd 100644 |
| 73 |
--- a/etrn.c |
| 74 |
+++ b/etrn.c |
| 75 |
@@ -31,7 +31,7 @@ static int etrn_ok (int sock, char *argbuf) |
| 76 |
} |
| 77 |
|
| 78 |
static int etrn_getrange(int sock, struct query *ctl, const char *id, |
| 79 |
- int *countp, int *newp, int *bytes) |
| 80 |
+ int *countp, int *newp, unsigned long long *bytes) |
| 81 |
/* send ETRN and interpret the response */ |
| 82 |
{ |
| 83 |
int ok, opts; |
| 84 |
diff --git a/fetchmail.h b/fetchmail.h |
| 85 |
index 23ba6e6e..72259e10 100644 |
| 86 |
--- a/fetchmail.h |
| 87 |
+++ b/fetchmail.h |
| 88 |
@@ -210,7 +210,7 @@ struct method /* describe methods for protocol state machine */ |
| 89 |
/* response_parsing function */ |
| 90 |
int (*getauth)(int, struct query *, char *); |
| 91 |
/* authorization fetcher */ |
| 92 |
- int (*getrange)(int, struct query *, const char *, int *, int *, int *); |
| 93 |
+ int (*getrange)(int, struct query *, const char *, int *, int *, unsigned long long *); |
| 94 |
/* get message range to fetch */ |
| 95 |
int (*getsizes)(int, int, int *); |
| 96 |
/* get sizes of messages */ |
| 97 |
diff --git a/imap.c b/imap.c |
| 98 |
index 7b80679a..7836acd7 100644 |
| 99 |
--- a/imap.c |
| 100 |
+++ b/imap.c |
| 101 |
@@ -883,7 +883,7 @@ static int imap_search(int sock, struct query *ctl, int count) |
| 102 |
static int imap_getrange(int sock, |
| 103 |
struct query *ctl, |
| 104 |
const char *folder, |
| 105 |
- int *countp, int *newp, int *bytes) |
| 106 |
+ int *countp, int *newp, unsigned long long *bytes) |
| 107 |
/* get range of messages to be fetched */ |
| 108 |
{ |
| 109 |
int ok; |
| 110 |
diff --git a/odmr.c b/odmr.c |
| 111 |
index 85decb6d..d1c011c4 100644 |
| 112 |
--- a/odmr.c |
| 113 |
+++ b/odmr.c |
| 114 |
@@ -36,7 +36,7 @@ static int odmr_ok (int sock, char *argbuf) |
| 115 |
} |
| 116 |
|
| 117 |
static int odmr_getrange(int sock, struct query *ctl, const char *id, |
| 118 |
- int *countp, int *newp, int *bytes) |
| 119 |
+ int *countp, int *newp, unsigned long long *bytes) |
| 120 |
/* send ODMR and then run a reverse SMTP session */ |
| 121 |
{ |
| 122 |
int ok, opts, smtp_sock; |
| 123 |
diff --git a/pop2.c b/pop2.c |
| 124 |
index 7c843616..5a5a1bd1 100644 |
| 125 |
--- a/pop2.c |
| 126 |
+++ b/pop2.c |
| 127 |
@@ -80,7 +80,7 @@ static int pop2_getauth(int sock, struct query *ctl, char *buf) |
| 128 |
} |
| 129 |
|
| 130 |
static int pop2_getrange(int sock, struct query *ctl, const char *folder, |
| 131 |
- int *countp, int *newp, int *bytes) |
| 132 |
+ int *countp, int *newp, unsigned long long *bytes) |
| 133 |
/* get range of messages to be fetched */ |
| 134 |
{ |
| 135 |
(void)ctl; |
| 136 |
diff --git a/pop3.c b/pop3.c |
| 137 |
index 6efe1b7e..25efbaad 100644 |
| 138 |
--- a/pop3.c |
| 139 |
+++ b/pop3.c |
| 140 |
@@ -969,7 +969,7 @@ static int pop3_slowuidl( int sock, struct query *ctl, int *countp, int *newp) |
| 141 |
static int pop3_getrange(int sock, |
| 142 |
struct query *ctl, |
| 143 |
const char *folder, |
| 144 |
- int *countp, int *newp, int *bytes) |
| 145 |
+ int *countp, int *newp, unsigned long long *bytes) |
| 146 |
/* get range of messages to be fetched */ |
| 147 |
{ |
| 148 |
int ok; |
| 149 |
@@ -992,7 +992,7 @@ static int pop3_getrange(int sock, |
| 150 |
if (ok == 0) { |
| 151 |
int asgn; |
| 152 |
|
| 153 |
- asgn = sscanf(buf,"%d %d", countp, bytes); |
| 154 |
+ asgn = sscanf(buf,"%d %llu", countp, bytes); |
| 155 |
if (asgn != 2) |
| 156 |
return PS_PROTOCOL; |
| 157 |
} else |
| 158 |
-- |
| 159 |
2.22.0 |
| 160 |
|