]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
userdbctl: do not show meaningless boundaries when no uid range available
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 16 Sep 2022 02:54:55 +0000 (11:54 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 16 Sep 2022 11:48:53 +0000 (20:48 +0900)
src/userdb/userdbctl.c

index 1930fb916b3f85cc7da8c23e27ce07504f27c31d..285d2453193066e877830daa867c3969b21dabcd 100644 (file)
@@ -180,8 +180,7 @@ static int table_add_uid_boundaries(
         for (size_t i = 0; i < ELEMENTSOF(uid_range_table); i++) {
                 _cleanup_free_ char *name = NULL, *comment = NULL;
 
-                if (n > 0 &&
-                    !uid_range_covers(p, n, uid_range_table[i].first, uid_range_table[i].last - uid_range_table[i].first + 1))
+                if (!uid_range_covers(p, n, uid_range_table[i].first, uid_range_table[i].last - uid_range_table[i].first + 1))
                         continue;
 
                 name = strjoin(special_glyph(SPECIAL_GLYPH_ARROW_DOWN),
@@ -543,8 +542,7 @@ static int table_add_gid_boundaries(
         for (size_t i = 0; i < ELEMENTSOF(uid_range_table); i++) {
                 _cleanup_free_ char *name = NULL, *comment = NULL;
 
-                if (n > 0 &&
-                    !uid_range_covers(p, n, uid_range_table[i].first, uid_range_table[i].last))
+                if (!uid_range_covers(p, n, uid_range_table[i].first, uid_range_table[i].last))
                         continue;
 
                 name = strjoin(special_glyph(SPECIAL_GLYPH_ARROW_DOWN),