From f9e6176c21ce807ee5be7ecf0ba84fec38e458cb Mon Sep 17 00:00:00 2001 From: reshke Date: Wed, 22 Nov 2023 19:52:16 +0000 Subject: [PATCH] Fix caching password for auth query --- sources/auth_query.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/auth_query.c b/sources/auth_query.c index 1662af975..b9f8eb90d 100644 --- a/sources/auth_query.c +++ b/sources/auth_query.c @@ -113,8 +113,8 @@ int od_auth_query(od_client_t *client, char *peer) od_hash_t keyhash; uint64_t current_time; - key.data = user->name; - key.len = user->name_len; + key.data = user->value; + key.len = user->value_len; keyhash = od_murmur_hash(key.data, key.len); /* acquire hash map entry lock */ @@ -139,7 +139,7 @@ int od_auth_query(od_client_t *client, char *peer) current_time - cache_value->timestamp < 10 * interval_usec) { od_debug(&instance->logger, "auth_query", NULL, NULL, "reusing cached password for user %.*s", - user->name_len, user->name); + user->value_len, user->value); /* unlock hashmap entry */ password->password_len = cache_value->passwd_len; if (cache_value->passwd_len > 0) {