Cyrus 2.0.16:

I've just stumbled onto what I think is a bug.  The quota struct in
mailbox.h defines 'int limit'.  I hadn't been able to figure out if
the quota limits were in bytes or kilobytes (I've since read the code
and figured it out) and I wanted to set large quotas as a failsafe
on a new installation (this is a small company server with plenty
of disk space) of 100MB, so I was using 104857600 (100*1024*1024),
which resulted in mysterious over-quota messages.  Now, my mistake
is clear, but I feel that Cyrus should have caught the overflow
when converting the string to int or used an unsigned int or both.
(Well, the more that I think about it, the clearer it is that just
using an unsigned int wouldn't have helped, since 104857600*1024 =
107374182400, which is still greater than 2^32.)

Considering that quotas are used in kilobytes, it should be a matter
of checking if the user-supplied quota is 2097151 ((2^31-1)/2)
or greater and return an error.


Wil
-- 
W. Reilly Cooley                           [EMAIL PROTECTED]
Naked Ape Consulting                        http://nakedape.cc
              * Linux and Network Consulting *
irc.linux.com                                     #orlug,#lnxs

A prohibitionist is the sort of man one wouldn't care to drink with
-- even if he drank.
                -- H.L. Mencken

Attachment: msg07324/pgp00000.pgp
Description: PGP signature

Reply via email to