Skip to content

Commit

Permalink
userblacklist: Be compatible with db_cachedb over MongoDB
Browse files Browse the repository at this point in the history
Issue reported by Ryan Embgrets

(cherry picked from commit f9fd982)
  • Loading branch information
liviuchircu committed Jul 30, 2020
1 parent d73cf52 commit 9a4c66e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/userblacklist/db.c
Expand Up @@ -107,7 +107,7 @@ int db_build_userbl_tree(const str *username, const str *domain, const str *tabl
if (RES_COL_N(res) > 1) {
for(i = 0; i < RES_ROW_N(res); i++) {
if ((!RES_ROWS(res)[i].values[0].nul) && (!RES_ROWS(res)[i].values[1].nul)) {
if ((RES_ROWS(res)[i].values[0].type == DB_STRING) &&
if ((RES_ROWS(res)[i].values[0].type == DB_STRING || RES_ROWS(res)[i].values[0].type == DB_STR) &&
(RES_ROWS(res)[i].values[1].type == DB_INT)) {

/* LM_DBG("insert into tree prefix %s, whitelist %d",
Expand Down Expand Up @@ -154,7 +154,7 @@ int db_reload_source(const str *table, struct dt_node_t *root)
if (RES_COL_N(res) > 1) {
for(i = 0; i < RES_ROW_N(res); i++) {
if ((!RES_ROWS(res)[i].values[0].nul) && (!RES_ROWS(res)[i].values[1].nul)) {
if ((RES_ROWS(res)[i].values[0].type == DB_STRING) &&
if ((RES_ROWS(res)[i].values[0].type == DB_STRING || RES_ROWS(res)[i].values[0].type == DB_STR) &&
(RES_ROWS(res)[i].values[1].type == DB_INT)) {

/* LM_DBG("insert into tree prefix %s, whitelist %d",
Expand Down

0 comments on commit 9a4c66e

Please sign in to comment.