user-record: make a NULL UserDBMatch be equivalent to no filtering

This commit is contained in:
Lennart Poettering
2025-01-23 21:32:12 +01:00
parent 6a43f0a73c
commit 83eabe102a
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -346,7 +346,9 @@ bool group_record_matches_group_name(const GroupRecord *g, const char *group_nam
int group_record_match(GroupRecord *h, const UserDBMatch *match) {
assert(h);
assert(match);
if (!match)
return true;
if (h->gid < match->gid_min || h->gid > match->gid_max)
return false;
+3 -1
View File
@@ -2694,7 +2694,9 @@ bool user_name_fuzzy_match(const char *names[], size_t n_names, char **matches)
int user_record_match(UserRecord *u, const UserDBMatch *match) {
assert(u);
assert(match);
if (!match)
return true;
if (u->uid < match->uid_min || u->uid > match->uid_max)
return false;