]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lslogins: ignore non-existing users
authorKarel Zak <kzak@redhat.com>
Fri, 18 Aug 2017 08:23:38 +0000 (10:23 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 18 Aug 2017 08:23:38 +0000 (10:23 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/lslogins.c

index 186ec6cbdfefe5ecc8c66d502717d0567d1f45d4..5d896d73c03a538c3eb1e95af25000c81d0c75cd 100644 (file)
@@ -895,12 +895,11 @@ static int create_usertree(struct lslogins_control *ctl)
        size_t n = 0;
 
        if (ctl->ulist_on) {
-               while (n < ctl->ulsiz) {
+               for (n = 0; n < ctl->ulsiz; n++) {
                        if (get_user(ctl, &user, ctl->ulist[n]))
-                               return -1;
+                               continue;
                        if (user) /* otherwise an invalid user name has probably been given */
                                tsearch(user, &ctl->usertree, cmp_uid);
-                       ++n;
                }
        } else {
                while ((user = get_next_user(ctl)))