]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Don't even try to open <file settings for modules we don't care about.
authorTimo Sirainen <tss@iki.fi>
Tue, 28 Sep 2010 16:09:50 +0000 (17:09 +0100)
committerTimo Sirainen <tss@iki.fi>
Tue, 28 Sep 2010 16:09:50 +0000 (17:09 +0100)
src/config/config-parser.c

index fbeb02aabc08caf88ea0d936eccb5fd6129b8bb8..bd007adeb4ebaa584967495a5f6c6db2a9ab264a 100644 (file)
@@ -656,8 +656,9 @@ static int config_write_value(struct config_parser_context *ctx,
                        str_append_c(str, '<');
                        str_append(str, value);
                } else {
-                       if (str_append_file(str, key, value, &error) < 0 &&
-                           config_require_key(ctx, key)) {
+                       if (!config_require_key(ctx, key)) {
+                               /* don't even try to open the file */
+                       } else if (str_append_file(str, key, value, &error) < 0) {
                                /* file reading failed */
                                ctx->error = p_strdup(ctx->pool, error);
                                return -1;