From: Karel Zak Date: Thu, 6 Jun 2019 10:33:03 +0000 (+0200) Subject: wall: make sure ut_line is not empty X-Git-Tag: v2.34~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=33985f1149598e9d5740cc6b851d979e3a8b84a5;p=thirdparty%2Futil-linux.git wall: make sure ut_line is not empty Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1711574 Signed-off-by: Karel Zak --- diff --git a/term-utils/wall.c b/term-utils/wall.c index c606e63474..c3e89bab9f 100644 --- a/term-utils/wall.c +++ b/term-utils/wall.c @@ -250,10 +250,12 @@ int main(int argc, char **argv) if (utmpptr->ut_type != USER_PROCESS) continue; #endif - /* Joey Hess reports that use-sessreg in /etc/X11/wdm/ - produces ut_line entries like :0, and a write - to /dev/:0 fails. */ - if (utmpptr->ut_line[0] == ':') + /* Joey Hess reports that use-sessreg in /etc/X11/wdm/ produces + * ut_line entries like :0, and a write to /dev/:0 fails. + * + * It also seems that some login manager may produce empty ut_line. + */ + if (!*utmpptr->ut_line || *utmpptr->ut_line == ':') continue; if (group_buf && !is_gr_member(utmpptr->ut_user, group_buf))