diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-05-11 20:55:02 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-05-11 20:55:02 +0400 |
commit | 389594cb0787aadb717717ca92d602692128153c (patch) | |
tree | 38e9fa2f47b20d40196a83410bfbf0616af97e62 /src/settings.c | |
parent | b673d0ee9641c0544ed2c6365ff349377ea5be0b (diff) | |
download | rspamd-389594cb0787aadb717717ca92d602692128153c.tar.gz rspamd-389594cb0787aadb717717ca92d602692128153c.zip |
Fix settings using.
Revert genmodules logic.
Diffstat (limited to 'src/settings.c')
-rw-r--r-- | src/settings.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/settings.c b/src/settings.c index 8d18880a0..8c13681ef 100644 --- a/src/settings.c +++ b/src/settings.c @@ -329,6 +329,8 @@ static gboolean check_setting (struct worker_task *task, struct rspamd_settings **user_settings, struct rspamd_settings **domain_settings) { gchar *field = NULL, *domain = NULL; + gchar cmp_buf[1024]; + gint len; if (task->deliver_to != NULL) { /* First try to use deliver-to field */ @@ -359,10 +361,17 @@ check_setting (struct worker_task *task, struct rspamd_settings **user_settings, /* First try to search per-user settings */ if (field != NULL) { - *user_settings = g_hash_table_lookup (task->cfg->user_settings, field); + if (*field == '<') { + field ++; + } + len = strcspn (field, ">"); + rspamd_strlcpy (cmp_buf, field, MIN (sizeof (cmp_buf), len + 1)); + *user_settings = g_hash_table_lookup (task->cfg->user_settings, cmp_buf); } if (domain != NULL) { - *domain_settings = g_hash_table_lookup (task->cfg->domain_settings, domain); + len = strcspn (domain, ">"); + rspamd_strlcpy (cmp_buf, domain, MIN (sizeof (cmp_buf), len + 1)); + *domain_settings = g_hash_table_lookup (task->cfg->domain_settings, cmp_buf); } if (*domain_settings != NULL || *user_settings != NULL) { |