From: Karel Zak Date: Fri, 18 Aug 2017 08:23:38 +0000 (+0200) Subject: lslogins: ignore non-existing users X-Git-Tag: v2.31-rc1~131 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f4513f27c2e2c8919bffcd7a356e364b0647eb29;p=thirdparty%2Futil-linux.git lslogins: ignore non-existing users Signed-off-by: Karel Zak --- diff --git a/login-utils/lslogins.c b/login-utils/lslogins.c index 186ec6cbdf..5d896d73c0 100644 --- a/login-utils/lslogins.c +++ b/login-utils/lslogins.c @@ -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)))