Small type bug in lmtpengine.c

David Carter dpc22 at cam.ac.uk
Wed Apr 22 09:54:15 EDT 2009


The quota parameter to verify_user() is quota_t, not long.

Solaris 10 with bundled GCC 3.4.3 wasn't doing type promotion correctly. 
(long)(-1) becomes (long long int)(4294967295), which is >= 0.

Consequently IGNOREQUOTA had no effect.

-- 
David Carter                             Email: David.Carter at ucs.cam.ac.uk
University Computing Service,            Phone: (01223) 334502
New Museums Site, Pembroke Street,       Fax:   (01223) 334679
Cambridge UK. CB2 3QH.

Index: imap/lmtpengine.c
===================================================================
RCS file: /data/ucvs/hermes/src/cyrus-imapd/imap/lmtpengine.c,v
retrieving revision 1.1.1.1
diff -u -d -r1.1.1.1 lmtpengine.c
--- imap/lmtpengine.c	25 Mar 2009 17:02:48 -0000	1.1.1.1
+++ imap/lmtpengine.c	22 Apr 2009 13:48:05 -0000
@@ -809,7 +809,7 @@
  static int process_recipient(char *addr, struct namespace *namespace,
  			     int ignorequota,
  			     int (*verify_user)(const char *, const char *,
-						char *, long,
+						char *, quota_t,
  						struct auth_state *),
  			     message_data_t *msg)
  {
@@ -898,7 +898,7 @@
  	ret->user = NULL;

      r = verify_user(ret->user, ret->domain, ret->mailbox,
-		    ignorequota ? -1 : msg->size, msg->authstate);
+		    (quota_t)(ignorequota ? -1 : msg->size), msg->authstate);
      if (r) {
  	/* we lost */
  	free(ret->all);


More information about the Cyrus-devel mailing list