[Dovecot] Deleting metadata smashes file dovecot.dict

Ewald Dieterich ewald.lists at fun.de
Tue Aug 28 17:42:13 EEST 2012


On 08/08/12 14:23, Andre Gröbe wrote:
> I am using dovecot (see dovecot -n output below) with metadata plugin in
> my own plugin. I want to insert and delete some large metadata (>4KiB).
> It seems, that the delete in a second call of my plugin smashes the file
> dovecot.dict in users dir:

That's an error in dict-file.c, file_dict_refresh():

   while ((key = i_stream_read_next_line(input)) != NULL &&
          (value = i_stream_read_next_line(input)) != NULL) {

If reading the value requires reading from the stream (because the value 
doesn't fit into the input buffer), the key is overwritten. The attached 
patch duplicates the key before reading the value.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dict-file.c.patch
Type: text/x-diff
Size: 665 bytes
Desc: not available
URL: <http://dovecot.org/pipermail/dovecot/attachments/20120828/848f73a2/attachment-0004.bin>


More information about the dovecot mailing list