bootchartd: prevent premature stop by device mapper

Kernel thread kdmflush was recognized as display manager kdm,
check for string length.

Signed-off-by: Uwe Geuder <busybox2017-ugeuder@snkmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Uwe Geuder 2017-07-19 22:08:08 +03:00 committed by Denys Vlasenko
parent 1ef3ce91c7
commit 9e2e0ff4ba

View File

@ -171,7 +171,9 @@ static int dump_procs(FILE *fp, int look_for_login_process)
p++; p++;
strchrnul(p, ')')[0] = '\0'; strchrnul(p, ')')[0] = '\0';
/* Is it gdm, kdm or a getty? */ /* Is it gdm, kdm or a getty? */
if (((p[0] == 'g' || p[0] == 'k' || p[0] == 'x') && p[1] == 'd' && p[2] == 'm') if (((p[0] == 'g' || p[0] == 'k' || p[0] == 'x')
&& p[1] == 'd' && p[2] == 'm' && p[3] == '\0'
)
|| strstr(p, "getty") || strstr(p, "getty")
) { ) {
found_login_process = 1; found_login_process = 1;