Skip to content

Commit 9ff6db6

Browse files
committed
Make LRU implementation bi-directional
Expanded the LRU node and queue structures to store both UID and name and manage them through dedicated UID and name hash tables. Introduced dual-lookup routines for retrieving cache entries by UID or name and wired them into the initialization and teardown logic. Updated UID/GID lookup helpers and normalization to leverage the new bidirectional LRU cache instead of direct system queries. Introduced tests verifying basic cache hits/misses and bidirectional UID↔name mapping to ensure consistent behavior of the new LRU implementation.
1 parent b9deb4d commit 9ff6db6

File tree

8 files changed

+831
-628
lines changed

8 files changed

+831
-628
lines changed

auparse/internal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ int aup_load_config(auparse_state_t *au, struct daemon_conf *config,
192192
log_test_t lt);
193193
void aup_free_config(struct daemon_conf *config);
194194

195+
/* Resolve @name to a uid, caching the result for future lookups. */
196+
uid_t lookup_uid_from_name(auparse_state_t *au, const char *name);
195197
// normalize.c
196198
void init_normalizer(normalize_data *d);
197199
void clear_normalizer(normalize_data *d);

0 commit comments

Comments
 (0)