1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-13 00:58:27 +03:00

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

This commit is contained in:
Lennart Poettering 2025-01-22 16:24:17 +01:00
parent 6a43f0a73c
commit 83eabe102a
2 changed files with 6 additions and 2 deletions

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;

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;