[Dovecot] [PATCH] settings parsing section/context return bug

Tom Alsberg alsbergt at cs.huji.ac.il
Sun Jul 31 16:35:18 EEST 2005


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;
 


More information about the dovecot mailing list