64-bit quota again (in 2.3.8).

2007-03-14 Thread Igor Zhbanov

Hello!

I use cyrus-imapd-2.3.8. According to change log:
--
Changes to the Cyrus IMAP Server since 2.2.x
...
   * Support 64-bit quota usage (both per mailbox and for the entire
quotaroot),
 based on a patch from Jeremy Rumpf. Development sponsored by FastMail.
--

But something doesn't work.

I log into cyradm and see following:

192.168.0.9 sq user/[EMAIL PROTECTED] STORAGE 20
192.168.0.9 sq user/[EMAIL PROTECTED] STORAGE 30
setquota: Invalid quota list in Setquota


After little digging in sources I have found a function cmd_setquota
in imap/imapd.c:
--
/*
* Parse and perform a SETQUOTA command
* The command has been parsed up to the resource list
*/
void cmd_setquota(const char *tag, const char *quotaroot)
{
   int newquota = -1;
..
   c = getword(imapd_in, arg);
   if (c != ')' || arg.s[0] != '\0') {
   for (;;) {
..
   newquota = 0;
   for (p = arg.s; *p; p++) {
   if (!isdigit((int) *p)) goto badlist;
   newquota = newquota * 10 + *p - '0';
   if (newquota  0) goto badlist; /* overflow */
   }
   if (c == ')') break;
   }
   }
..
   return;

badlist:
   prot_printf(imapd_out, %s BAD Invalid quota list in Setquota\r\n, tag);
   eatline(imapd_in, c);
}
--

But, as you may see, variable 'newqouta' is a type of 'int' and not 'int64'
or 'long' or something greater than 32-bit.

So, the first question, what is the units used with command 'sq' of cyradm.
If bytes, than is there any patches to fix this problem?

Thanks.

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: 64-bit quota again (in 2.3.8).

2007-03-14 Thread Sebastian Hagedorn
-- Igor Zhbanov [EMAIL PROTECTED] is rumored to have mumbled on 14. März 
2007 15:03:51 +0300 regarding 64-bit quota again (in 2.3.8).:



But, as you may see, variable 'newqouta' is a type of 'int' and not
'int64'
or 'long' or something greater than 32-bit.

So, the first question, what is the units used with command 'sq' of
cyradm.


It's kilobytes.
--
Sebastian Hagedorn - RZKR-R1 (Flachbau), Zi. 18, Robert-Koch-Str. 10
Zentrum für angewandte Informatik - Universitätsweiter Service RRZK
Universität zu Köln / Cologne University - Tel. +49-221-478-5587

pgpAmGyhBQHGg.pgp
Description: PGP signature

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html