]> 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>
Wed, 20 Sep 2017 12:19:09 +0000 (14:19 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/lslogins.c

index ab04c10bb2214f738feed77219ce4ae6deec4e70..d26e3d95f575b00819a50aa5f4bd4d4aa3ccfbe5 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)))