diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-11-12 15:14:35 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-11-12 15:14:35 +0000 |
commit | 56fdb79c495ab76cbde7cc7b12d3751b662fb9c4 (patch) | |
tree | 43fde227600ce7cd3036e12eb9799108fde399bd /src/libutil/util.c | |
parent | 7ea334cd83f09d7c7ad7f1795cbf702fd137979c (diff) | |
download | rspamd-56fdb79c495ab76cbde7cc7b12d3751b662fb9c4.tar.gz rspamd-56fdb79c495ab76cbde7cc7b12d3751b662fb9c4.zip |
Add external libraries context
Diffstat (limited to 'src/libutil/util.c')
-rw-r--r-- | src/libutil/util.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libutil/util.c b/src/libutil/util.c index 816d794dc..1a70f1b6f 100644 --- a/src/libutil/util.c +++ b/src/libutil/util.c @@ -1906,11 +1906,13 @@ rspamd_gstring_free_soft (gpointer p) g_string_free (ar, FALSE); } -void +struct rspamd_external_libs_ctx * rspamd_init_libs (void) { struct rlimit rlim; + struct rspamd_external_libs_ctx *ctx; + ctx = g_slice_alloc0 (sizeof (*ctx)); rspamd_cryptobox_init (); ottery_init (NULL); @@ -1949,6 +1951,11 @@ rspamd_init_libs (void) #else g_mime_init (0); #endif + ctx->libmagic = magic_open (MAGIC_MIME|MAGIC_NO_CHECK_COMPRESS| + MAGIC_NO_CHECK_ELF|MAGIC_NO_CHECK_TAR|MAGIC_NO_CHECK_TEXT); + magic_compile (ctx->libmagic, NULL); + + return ctx; } guint64 |