dovecot-2.0: config: key="<value" shouldn't treat value as file.

dovecot at dovecot.org dovecot at dovecot.org
Sat Oct 10 02:05:52 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/4442b6aa5a66
changeset: 10026:4442b6aa5a66
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Oct 09 19:05:47 2009 -0400
description:
config: key="<value" shouldn't treat value as file.

diffstat:

1 file changed, 9 insertions(+), 2 deletions(-)
src/config/config-parser.c |   11 +++++++++--

diffs (40 lines):

diff -r 6556754b6c24 -r 4442b6aa5a66 src/config/config-parser.c
--- a/src/config/config-parser.c	Fri Oct 09 18:45:29 2009 -0400
+++ b/src/config/config-parser.c	Fri Oct 09 19:05:47 2009 -0400
@@ -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 *
 		*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;
 			}


More information about the dovecot-cvs mailing list