/* Privilleged password */
gchar *enable_password;
/* Cached versions of the passwords */
- rspamd_fstring_t cached_password;
- rspamd_fstring_t cached_enable_password;
+ rspamd_ftok_t cached_password;
+ rspamd_ftok_t cached_enable_password;
/* HTTP server */
struct rspamd_http_connection_router *http;
/* Server's start time */
gsize salt_len, key_len;
gboolean ret = TRUE;
guchar *local_key;
- rspamd_fstring_t *cache;
+ rspamd_ftok_t *cache;
+ gpointer m;
/* First of all check cached versions to save resources */
if (is_enable && ctx->cached_enable_password.len != 0) {
if (cache->len == 0) {
/* Mmap region */
- cache->begin = mmap (NULL, password->len, PROT_WRITE,
+ m = mmap (NULL, password->len, PROT_WRITE,
MAP_PRIVATE | MAP_ANON, -1, 0);
- memcpy (cache->begin, password->str, password->len);
- (void)mprotect (cache->begin, password->len, PROT_READ);
- (void)mlock (cache->begin, password->len);
+ memcpy (m, password->str, password->len);
+ (void)mprotect (m, password->len, PROT_READ);
+ (void)mlock (m, password->len);
+ cache->begin = m;
cache->len = password->len;
}
}
gpointer key, value;
struct rspamd_keypair_cache *cache;
gchar *secure_ip;
+ gpointer m;
ctx->ev_base = rspamd_prepare_worker (worker,
"controller",
}
if (ctx->cached_password.len > 0) {
- munmap (ctx->cached_password.begin, ctx->cached_password.len);
+ m = (gpointer)ctx->cached_password.begin;
+ munmap (m, ctx->cached_password.len);
}
if (ctx->cached_enable_password.len > 0) {
- munmap (ctx->cached_enable_password.begin, ctx->cached_enable_password.len);
+ m = (gpointer) ctx->cached_enable_password.begin;
+ munmap (m, ctx->cached_enable_password.len);
}
exit (EXIT_SUCCESS);
}
static void
-proxy_parse_smtp_input (rspamd_fstring_t *line, struct smtp_proxy_session *session)
+proxy_parse_smtp_input (rspamd_ftok_t *line, struct smtp_proxy_session *session)
{
- gchar *p, *c, *end;
+ const gchar *p, *c, *end;
gsize len;
p = line->begin;
* Callback that is called when there is data to read in buffer
*/
static gboolean
-smtp_proxy_read_socket (rspamd_fstring_t * in, void *arg)
+smtp_proxy_read_socket (rspamd_ftok_t * in, void *arg)
{
struct smtp_proxy_session *session = arg;
- gchar *p;
+ const gchar *p;
if (session->state != SMTP_PROXY_STATE_REJECT_EMULATE) {
/* This can be called only if client is using invalid pipelining */