]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: key="<value" shouldn't treat value as file.
authorTimo Sirainen <tss@iki.fi>
Fri, 9 Oct 2009 23:05:47 +0000 (19:05 -0400)
committerTimo Sirainen <tss@iki.fi>
Fri, 9 Oct 2009 23:05:47 +0000 (19:05 -0400)
--HG--
branch : HEAD

src/config/config-parser.c

index 3ff1cd8c298c4e49dc5b2ffa1e4781ae850520cd..d067669319e3b27582d419357ec5a2120597a781 100644 (file)
@@ -406,6 +406,7 @@ enum config_line_type {
        CONFIG_LINE_TYPE_SKIP,
        CONFIG_LINE_TYPE_ERROR,
        CONFIG_LINE_TYPE_KEYVALUE,
+       CONFIG_LINE_TYPE_KEYFILE,
        CONFIG_LINE_TYPE_SECTION_BEGIN,
        CONFIG_LINE_TYPE_SECTION_END,
        CONFIG_LINE_TYPE_INCLUDE,
@@ -489,6 +490,11 @@ config_parse_line(char *line, string_t *full_line, const char **key_r,
                *line++ = '\0';
                while (IS_WHITE(*line)) line++;
 
+               if (*line == '<') {
+                       *value_r = line + 1;
+                       return CONFIG_LINE_TYPE_KEYFILE;
+               }
+
                len = strlen(line);
                if (len > 0 &&
                    ((*line == '"' && line[len-1] == '"') ||
@@ -612,13 +618,14 @@ prevfile:
                        errormsg = value;
                        break;
                case CONFIG_LINE_TYPE_KEYVALUE:
+               case CONFIG_LINE_TYPE_KEYFILE:
                        str_truncate(str, pathlen);
                        str_append(str, key);
                        str_append_c(str, '=');
 
-                       if (*value != '<' || !expand_files)
+                       if (type != CONFIG_LINE_TYPE_KEYFILE || !expand_files)
                                str_append(str, value);
-                       else if (str_append_file(str, key, value+1, &errormsg) < 0) {
+                       else if (str_append_file(str, key, value, &errormsg) < 0) {
                                /* file reading failed */
                                break;
                        }