Parcourir la source

[Fix] Fix various warnings and issues

tags/1.4.1
Vsevolod Stakhov il y a 7 ans
Parent
révision
a93fbccaea

+ 1
- 1
src/controller.c Voir le fichier

@@ -1500,7 +1500,7 @@ rspamd_controller_handle_lua (struct rspamd_http_connection_entry *conn_ent,
}

rspamd_snprintf (filebuf, sizeof (filebuf), "%s%c%T",
ctx->static_files_dir, G_DIR_SEPARATOR, lookup);
ctx->static_files_dir, G_DIR_SEPARATOR, &lookup);

if (realpath (filebuf, realbuf) == NULL ||
lstat (realbuf, &st) == -1) {

+ 2
- 2
src/libserver/cfg_utils.c Voir le fichier

@@ -1271,11 +1271,11 @@ rspamd_check_module (struct rspamd_config *cfg, module_t *mod)
if (mod != NULL) {
if (mod->module_version != RSPAMD_CUR_MODULE_VERSION) {
msg_err_config ("module %s has incorrect version %xd (%xd expected)",
mod->name, mod->module_version, RSPAMD_CUR_MODULE_VERSION);
mod->name, (gint)mod->module_version, RSPAMD_CUR_MODULE_VERSION);
ret = FALSE;
}
if (ret && mod->rspamd_version != RSPAMD_VERSION_NUM) {
msg_err_config ("module %s has incorrect rspamd version %xd (%xd expected)",
msg_err_config ("module %s has incorrect rspamd version %xL (%xL expected)",
mod->name, mod->rspamd_version, RSPAMD_VERSION_NUM);
ret = FALSE;
}

+ 1
- 5
src/libstat/backends/mmaped_file.c Voir le fichier

@@ -564,10 +564,6 @@ rspamd_mmaped_file_open (rspamd_mempool_t *pool,
{
struct stat st;
rspamd_mmaped_file_t *new_file;
struct timespec sleep_ts = {
.tv_sec = 0,
.tv_nsec = 1000000
};
gchar *lock;
gint lock_fd;

@@ -576,7 +572,7 @@ rspamd_mmaped_file_open (rspamd_mempool_t *pool,

if (lock_fd == -1) {
msg_info_pool ("cannot open file %s, it is locked by another process",
filename, strerror (errno), errno);
filename);
return NULL;
}


+ 1
- 1
src/libstat/stat_process.c Voir le fichier

@@ -135,7 +135,7 @@ rspamd_stat_tokenize_parts_metadata (struct rspamd_stat_ctx *st_ctx,

if (part->content && part->content->len > 1) {
rspamd_snprintf (tmpbuf, sizeof (tmpbuf), "mime%d:%dlog",
(gint)log2 (part->content->len));
i, (gint)log2 (part->content->len));
elt.begin = rspamd_mempool_strdup (task->task_pool, tmpbuf);
elt.len = strlen (elt.begin);
g_array_append_val (ar, elt);

+ 2
- 2
src/libutil/radix.c Voir le fichier

@@ -88,13 +88,13 @@ radix_insert_compressed (radix_compressed_t * tree,
msg_err_radix ("cannot insert %p, key: %s/%d, duplicate value",
(gpointer)value,
inet_ntop (AF_INET, key, ip_str, sizeof (ip_str) - 1),
keybits - masklen);
(gint)(keybits - masklen));
}
else if (keybits == 128) {
msg_err_radix ("cannot insert %p, key: [%s]/%d, duplicate value",
(gpointer)value,
inet_ntop (AF_INET6, key, ip_str, sizeof (ip_str) - 1),
keybits - masklen);
(gint)(keybits - masklen));
}
else {
msg_err_radix ("cannot insert %p with mask %z, key: %*xs, duplicate value",

+ 1
- 1
src/libutil/regexp.c Voir le fichier

@@ -489,7 +489,7 @@ fin:
#endif
if (res->raw_re == NULL) {
msg_warn ("raw regexp parsing error: '%s': '%s' at position %d",
err_str, (gint)err_off);
err_str, real_pattern, (gint)err_off);
}
}


+ 2
- 2
src/libutil/sqlite_utils.c Voir le fichier

@@ -423,12 +423,12 @@ rspamd_sqlite3_open_or_create (rspamd_mempool_t *pool, const gchar *path, const
GString *new_ver_sql;

if (sqlite3_prepare (sqlite, db_version, -1, &stmt, NULL) != SQLITE_OK) {
msg_warn_pool_check ("Cannot get user version pragma",
msg_warn_pool_check ("Cannot get user version pragma: %s",
sqlite3_errmsg (sqlite));
}
else {
if (sqlite3_step (stmt) != SQLITE_ROW) {
msg_warn_pool_check ("Cannot get user version pragma, step failed",
msg_warn_pool_check ("Cannot get user version pragma, step failed: %s",
sqlite3_errmsg (sqlite));
sqlite3_finalize (stmt);
}

+ 2
- 2
src/log_helper.c Voir le fichier

@@ -94,8 +94,8 @@ rspamd_log_helper_read (gint fd, short what, gpointer ud)
(r - sizeof (*sm)) / sizeof (struct rspamd_protocol_log_symbol_result)) {
msg_warn ("cannot read data from log pipe: bad length: %d elements "
"announced but %d available", n + nextra,
(r - sizeof (*sm)) /
sizeof (struct rspamd_protocol_log_symbol_result));
(gint)((r - sizeof (*sm)) /
sizeof (struct rspamd_protocol_log_symbol_result)));
}
else {
sm = g_malloc (r);

+ 1
- 1
src/plugins/dkim_check.c Voir le fichier

@@ -912,7 +912,7 @@ dkim_sign_callback (struct rspamd_task *task, void *unused)

if (ctx == NULL) {
msg_err_task ("cannot create sign context: %e",
key, err);
err);
g_error_free (err);

return;

+ 2
- 1
src/plugins/fuzzy_check.c Voir le fichier

@@ -455,7 +455,8 @@ fuzzy_parse_rule (struct rspamd_config *cfg, const ucl_object_t *obj,
rule->alg = RSPAMD_SHINGLES_FAST;
}
else {
msg_warn_config ("unknown algorithm: %s, use siphash by default");
msg_warn_config ("unknown algorithm: %s, use siphash by default",
rule->algorithm_str);
}
}
}

+ 1
- 1
src/rspamadm/fuzzy_convert.c Voir le fichier

@@ -23,7 +23,7 @@ static gchar *source_db = NULL;
static gchar *redis_host = NULL;
static gchar *redis_db = NULL;
static gchar *redis_password = NULL;
static int64_t fuzzy_expiry = NULL;
static int64_t fuzzy_expiry = 0;

static void rspamadm_fuzzyconvert (gint argc, gchar **argv);
static const char *rspamadm_fuzzyconvert_help (gboolean full_help);

+ 4
- 2
src/rspamadm/signtool.c Voir le fichier

@@ -536,8 +536,10 @@ rspamadm_signtool (gint argc, gchar **argv)
RSPAMD_KEYPAIR_SIGN, mode);

if (pk == NULL) {
rspamd_fprintf (stderr, "bad size %s: %ud, %ud expected\n", flen,
rspamd_cryptobox_pk_sig_bytes (mode));
rspamd_fprintf (stderr, "bad size %s: %ud, %ud expected\n",
pubkey_file,
(guint)flen,
rspamd_cryptobox_pk_sig_bytes (mode));
exit (errno);
}


Chargement…
Annuler
Enregistrer