init: reprompt login: if blank user name
authorAlan Cox <alan@linux.intel.com>
Sun, 2 Sep 2018 13:24:47 +0000 (14:24 +0100)
committerAlan Cox <alan@linux.intel.com>
Sun, 2 Sep 2018 13:24:47 +0000 (14:24 +0100)
Applications/util/init.c

index 70640c9..cf4a552 100644 (file)
@@ -837,6 +837,9 @@ static pid_t getty(const char **argv, const char *id)
                                if ((p = strchr(buf, '\n')) != NULL)
                                        *p = '\0';      /* strip newline */
 
+                               if (*buf == 0)
+                                       continue;
+
                                pwd = getpwnam(buf);
 
                                if (pwd == NULL || *pwd->pw_passwd)