From 8ef347de677218b4aa4b80bceff40a5740f4dc4b Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Mon, 8 Apr 2024 20:24:23 +0800 Subject: [PATCH] userdbctl: correct uid_range_covers check The third param should be the number of uids. --- src/userdb/userdbctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/userdb/userdbctl.c b/src/userdb/userdbctl.c index 835cea9c00c..918b4d772f2 100644 --- a/src/userdb/userdbctl.c +++ b/src/userdb/userdbctl.c @@ -535,7 +535,7 @@ static int table_add_gid_boundaries(Table *table, const UIDRange *p) { FOREACH_ARRAY(i, uid_range_table, ELEMENTSOF(uid_range_table)) { _cleanup_free_ char *name = NULL, *comment = NULL; - if (!uid_range_covers(p, i->first, i->last)) + if (!uid_range_covers(p, i->first, i->last - i->first + 1)) continue; name = strjoin(special_glyph(SPECIAL_GLYPH_ARROW_DOWN), -- 2.47.3