aboutsummaryrefslogtreecommitdiffstats
path: root/src/map.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-11-13 18:17:00 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-11-13 18:17:00 +0000
commit2a0a59ee52a424d10bc7d1d5d77c451b842d8e00 (patch)
treeb7c03551c82a4327c12a1aa438df29aa3b0078ed /src/map.c
parent3893d490abaa275fcadf180ff4ffc88e159f5c04 (diff)
downloadrspamd-2a0a59ee52a424d10bc7d1d5d77c451b842d8e00.tar.gz
rspamd-2a0a59ee52a424d10bc7d1d5d77c451b842d8e00.zip
Expand path in file maps.
Diffstat (limited to 'src/map.c')
-rw-r--r--src/map.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/map.c b/src/map.c
index 7c61dcc9e..25541a7e6 100644
--- a/src/map.c
+++ b/src/map.c
@@ -1044,9 +1044,16 @@ add_map (struct config_file *cfg, const gchar *map_line, const gchar *descriptio
new_map->user_data = user_data;
new_map->protocol = proto;
new_map->cfg = cfg;
- new_map->uri = memory_pool_strdup (cfg->cfg_pool, proto == MAP_PROTO_FILE ? def : map_line);
new_map->id = g_random_int ();
new_map->locked = memory_pool_alloc0_shared (cfg->cfg_pool, sizeof (gint));
+
+ if (proto == MAP_PROTO_FILE) {
+ new_map->uri = rspamd_expand_path (cfg->cfg_pool, def);
+ def = new_map->uri;
+ }
+ else {
+ new_map->uri = memory_pool_strdup (cfg->cfg_pool, map_line);
+ }
if (description != NULL) {
new_map->description = memory_pool_strdup (cfg->cfg_pool, description);
}