Skip to content

Commit

Permalink
Fix caching password for auth query
Browse files Browse the repository at this point in the history
  • Loading branch information
reshke committed Nov 22, 2023
1 parent d06e007 commit 8c7b6c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sources/auth_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -135,7 +135,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;
password->password = malloc(password->password_len + 1);
Expand Down

0 comments on commit 8c7b6c6

Please sign in to comment.