/* preserve original relative path in doveconf output */
if (full_path != path && ctx->expand_values)
path = full_path;
- if (settings_parse_read_file(full_path, path, ctx->pool, output_r, &error) < 0) {
+ if (settings_parse_read_file(full_path, path, ctx->pool, NULL,
+ output_r, &error) < 0) {
ctx->error = p_strdup(ctx->pool, error);
if (config_apply_error(ctx, line->key) < 0)
return -1;
const char *ca_value;
if (settings_parse_read_file("/etc/pki/tls/cert.pem",
"/etc/pki/tls/cert.pem",
- unsafe_data_stack_pool,
+ unsafe_data_stack_pool, NULL,
&ca_value, &error) < 0)
i_fatal("%s", error);
settings_file_get(ca_value, unsafe_data_stack_pool,
}
const char *error;
- if (settings_parse_read_file(*value, *value, ctx->set_pool,
+ if (settings_parse_read_file(*value, *value, ctx->set_pool, NULL,
value, &error) < 0) {
settings_parser_set_error(ctx, error);
return -1;
}
int settings_parse_read_file(const char *path, const char *value_path,
- pool_t pool,
+ pool_t pool, struct stat *st_r,
const char **output_r, const char **error_r)
{
struct stat st;
return -1;
}
+ if (st_r != NULL)
+ *st_r = st;
*output_r = buf;
return 0;
}
#include "str-parse.h"
+struct stat;
struct var_expand_table;
struct var_expand_provider;
/* Read a SET_FILE from the given path and write "value_path\ncontents" to
output_r. Returns 0 on success, -1 on error. */
int settings_parse_read_file(const char *path, const char *value_path,
- pool_t pool,
+ pool_t pool, struct stat *st_r,
const char **output_r, const char **error_r);
int settings_parse_boollist_string(const char *value, pool_t pool,
ARRAY_TYPE(const_string) *dest,