bootchartd: prevent premature stop by device mapper
authorUwe Geuder <busybox2017-ugeuder@snkmail.com>
Wed, 19 Jul 2017 19:08:08 +0000 (22:08 +0300)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 20 Jul 2017 11:39:41 +0000 (13:39 +0200)
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>
init/bootchartd.c

index ecbcab8685dce91c696379670874ed5ad4e03416..1b7006798dd4b296417abf92f8780a7a8e442c8e 100644 (file)
@@ -171,7 +171,9 @@ static int dump_procs(FILE *fp, int look_for_login_process)
                        p++;
                        strchrnul(p, ')')[0] = '\0';
                        /* 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")
                        ) {
                                found_login_process = 1;