[Dovecot] Quota with dict backend - sql does not get registered
Timo Sirainen
tss at iki.fi
Mon Jul 31 22:43:01 EEST 2006
On Mon, 2006-07-31 at 12:19 -0700, David Jonas wrote:
> On Fri, 2006-07-28 at 15:56 -0700, David Jonas wrote:
> > Hello everyone,
> >
> > I've been working with the quota plugin, attempting to use the dict
> > backend. It seems the sql dict class is not getting loaded. I dropped a
> > couple lines in dict_class_lookup(dict.c) and it seems the only class
> > that gets loaded is "proxy". Any idea how to get the sql driver to load
> > in the quota/dict module?
>
> I added the code to load the driver in src/imap/main.c following the
> example from dict-client registration. Modified the Makefile, etc, got
> it to compile. But it seg faults when imap is run. Traced it to
> src/lib-dict/dict-sql.c:
>
> /* @UNSAFE */
> drivers = array_get(&sql_drivers, &count);
> dict_sql_classes = i_new(struct dict, count + 1);
>
> So, the comments don't lie. It is unsafe.
Actually the @UNSAFE means pretty different thing. It's just a pointer
that the code is doing there memory allocation calculations and that if
you aren't careful you can cause security holes in there.
> Looks like that is why the
> dict-server is the default with the proxy backend only. I guess I'll
> poke around more. Advice on how to skirt this would be appreciated.
After I just yesterday added Berkeley DB support for lib-dict, I thought
maybe everyone should just use dict via the proxy. The dict server is
linked against all the necessary libraries, and it's probably faster to
make it go through dict server anyway. Otherwise it gets a bit difficult
to figure out how the linking should work..
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20060731/42192f06/attachment.pgp
More information about the dovecot
mailing list