On Wed, 2009-09-09 at 15:07 +0100, Siraj 'Sid' Rakhada wrote:
> Am seeing an odd problem on an old FreeBSD 4.11 box that I'm trying to
> get courier off, and dovecot on. At the same time, I'm trying to put
> some fairly simple quota support on, but getting very odd results.

My guess is that this code doesn't work correctly in
src/plugins/quota/quota-maildir.c:

                if (sscanf(*lines, "%lld %d", &bytes_diff, &count_diff) != 2)
                        return -1;

You could try if the attached patch fixes it for you.

diff -r b359aac78f92 src/plugins/quota/quota-maildir.c
--- a/src/plugins/quota/quota-maildir.c	Wed Sep 09 00:50:16 2009 -0400
+++ b/src/plugins/quota/quota-maildir.c	Wed Sep 09 17:06:20 2009 -0400
@@ -441,7 +441,7 @@
 {
 	struct quota_root *_root = &root->root;
 	uint64_t message_bytes_limit, message_count_limit;
-	long long bytes_diff, total_bytes;
+	long bytes_diff, total_bytes;
 	int count_diff, total_count;
 	unsigned int line_count = 0;
 
@@ -480,7 +480,7 @@
 	/* rest of the lines contains <bytes> <count> diffs */
 	total_bytes = 0; total_count = 0;
 	for (lines++; *lines != NULL; lines++, line_count++) {
-		if (sscanf(*lines, "%lld %d", &bytes_diff, &count_diff) != 2)
+		if (sscanf(*lines, "%ld %d", &bytes_diff, &count_diff) != 2)
 			return -1;
 
 		total_bytes += bytes_diff;

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to