The file specified by 'h1-case-adjust-file' directive is only loaded during
post-parsing. However when a relative path is used, the corresponding
absoulte path was not resolve during parsing. So the file could be loaded
relatively from the wrong location leading to a configuration error. It may
happen if several configuration files are used or if several
"default-config" are used. The last "default" location was always used.
To fix the issue, the absolute path of the file is now resolved when the
directive is parsed.
This patch should fix the issue #3415. It must be backported to all
versions.
return -1;
}
free(hdrs_map.name);
- hdrs_map.name = strdup(args[1]);
+ if (args[1][0] != '/') {
+ char *curpath;
+ char *fullpath = NULL;
+
+ /* filename is provided using relative path, store the absolute path
+ * to take current chdir into account for other threads file load
+ * which occur later
+ */
+ curpath = getcwd(trash.area, trash.size);
+ if (!curpath) {
+ memprintf(err, "failed to retrieve cur path");
+ return -1;
+ }
+ hdrs_map.name = memprintf(&fullpath, "%s/%s", curpath, args[1]);
+ }
+ else
+ hdrs_map.name = strdup(args[1]);
+
if (!hdrs_map.name) {
memprintf(err, "'%s %s' : out of memory", args[0], args[1]);
return -1;