]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
userdbctl: correct uid_range_covers check 32156/head
authorMike Yuan <me@yhndnzj.com>
Mon, 8 Apr 2024 12:24:23 +0000 (20:24 +0800)
committerMike Yuan <me@yhndnzj.com>
Mon, 8 Apr 2024 12:24:23 +0000 (20:24 +0800)
The third param should be the number of uids.

src/userdb/userdbctl.c

index 835cea9c00cca5ef35cbdea922227dd826ed6ff8..918b4d772f28ea126783e0fad82945a2ff32880e 100644 (file)
@@ -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),