Skip to content

Commit

Permalink
Auth fix (#547)
Browse files Browse the repository at this point in the history
* Fix caching password for auth query

* Logging fix
  • Loading branch information
reshke authored Nov 23, 2023
1 parent 7420b6a commit b248569
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 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 @@ -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) {
Expand All @@ -165,8 +165,8 @@ int od_auth_query(od_client_t *client, char *peer)
}

od_debug(&instance->logger, "auth_query", auth_client, NULL,
"acquiring password for user %.*s", user->name_len,
user->name);
"acquiring password for user %.*s", user->value_len,
user->value);

/* set auth query route user and database */
kiwi_var_set(&auth_client->startup.user, KIWI_VAR_UNDEF,
Expand Down

0 comments on commit b248569

Please sign in to comment.