Tom Alsberg
2005-Jul-31 13:35 UTC
[Dovecot] [PATCH] settings parsing section/context return bug
There seems to be a minor bug in the settings parsing code (as of today's dovecot-stable snapshot - 20050731) - after the closing bracket of protocol (imap/pop3) {} section, the parser still regards all options as affecting only that protocol and not globally (I have some options, protocol imap {}, protocol pop3 {}, and then some more options - now those latter options seem to only affect POP3). It seems to be solved by the attached patch. Merely that the sub-section level has to be decreased after checking that it is positive (for returning the protocol in context to ANY). Would that change (prefix to postfix decrement) break anything else? If not, can it be applied? -- Tom -- Tom Alsberg - hacker (being the best description fitting this space) Web page: http://www.cs.huji.ac.il/~alsbergt/ DISCLAIMER: The above message does not even necessarily represent what my fingers have typed on the keyboard, save anything further. -------------- next part -------------- diff -urN src.orig/master/master-settings.c src/master/master-settings.c --- src.orig/master/master-settings.c Mon Jan 31 18:37:55 2005 +++ src/master/master-settings.c Sun Jul 31 15:18:18 2005 @@ -825,7 +825,7 @@ if (type == NULL) { /* section closing */ - if (--ctx->level > 0) { + if (ctx->level-- > 0) { ctx->type = ctx->parent_type; ctx->protocol = MAIL_PROTOCOL_ANY;
Timo Sirainen
2005-Aug-07 12:52 UTC
[Dovecot] [PATCH] settings parsing section/context return bug
On Sun, 2005-07-31 at 16:35 +0300, Tom Alsberg wrote:> There seems to be a minor bug in the settings parsing code (as of > today's dovecot-stable snapshot - 20050731) - after the closing > bracket of protocol (imap/pop3) {} section, the parser still regards > all options as affecting only that protocol and not globally (I have > some options, protocol imap {}, protocol pop3 {}, and then some more > options - now those latter options seem to only affect POP3). > > It seems to be solved by the attached patch. Merely that the > sub-section level has to be decreased after checking that it is > positive (for returning the protocol in context to ANY). Would that > change (prefix to postfix decrement) break anything else? If not, can > it be applied?Committed to CVS, thanks. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20050807/cef6e873/attachment.bin>