diff --git a/odyssey-dev.conf b/odyssey-dev.conf index ebb0af18..8f201ddc 100644 --- a/odyssey-dev.conf +++ b/odyssey-dev.conf @@ -1,4 +1,4 @@ -pid_file "/var/run/odyssey.pid" +pid_file "/tmp/odyssey.pid" daemonize no unix_socket_dir "/tmp" @@ -116,7 +116,7 @@ database "postgres" { client_max 107 } user default { - authentication "md5" + authentication "scram-sha-256" storage "postgres_server" @@ -144,5 +144,5 @@ database "console" { locks_dir "/tmp/odyssey" graceful_die_on_errors yes -enable_online_restart yes +enable_online_restart no bindwith_reuseport yes diff --git a/sources/auth_query.c b/sources/auth_query.c index 023e00f0..b592e3ea 100644 --- a/sources/auth_query.c +++ b/sources/auth_query.c @@ -232,7 +232,11 @@ int od_auth_query(od_global_t *global, od_rule_t *rule, char *peer, } } - rc = od_auth_query_do(server, rule->auth_query, user, password); + /* preformat and execute query */ + char query[OD_QRY_MAX_SZ]; + od_auth_query_format(rule, user, peer, query, sizeof(query)); + + rc = od_auth_query_do(server, query, user, password); if (rc == -1) { od_router_close(router, auth_client); od_router_unroute(router, auth_client); diff --git a/third_party/machinarium/sources/channel.c b/third_party/machinarium/sources/channel.c index 4c5913f4..26119e17 100644 --- a/third_party/machinarium/sources/channel.c +++ b/third_party/machinarium/sources/channel.c @@ -96,7 +96,7 @@ mm_msg_t *mm_channel_read(mm_channel_t *channel, uint32_t time_ms) mm_sleeplock_lock(&channel->lock); mm_list_t *next; - if ((channel->msg_list_count) > 0 && (channel->readers_count == 0)) { + if ((channel->msg_list_count > 0) && (channel->readers_count == 0)) { next = mm_list_pop(&channel->msg_list); channel->msg_list_count--; mm_sleeplock_unlock(&channel->lock);