64-bit quota again (in 2.3.8).

Igor Zhbanov izh1979 at gmail.com
Wed Mar 14 07:03:51 EST 2007


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/test2 at test.agvir.com STORAGE 2000000000
192.168.0.9> sq user/test2 at test.agvir.com STORAGE 3000000000
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.


More information about the Info-cyrus mailing list