diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-11-13 18:17:00 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-11-13 18:17:00 +0000 |
commit | 2a0a59ee52a424d10bc7d1d5d77c451b842d8e00 (patch) | |
tree | b7c03551c82a4327c12a1aa438df29aa3b0078ed /src/map.c | |
parent | 3893d490abaa275fcadf180ff4ffc88e159f5c04 (diff) | |
download | rspamd-2a0a59ee52a424d10bc7d1d5d77c451b842d8e00.tar.gz rspamd-2a0a59ee52a424d10bc7d1d5d77c451b842d8e00.zip |
Expand path in file maps.
Diffstat (limited to 'src/map.c')
-rw-r--r-- | src/map.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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); } |