init: build new utmp entry with short tty name.
authorBrett Gordon <beretta42@gmail.com>
Tue, 26 Apr 2016 15:18:52 +0000 (11:18 -0400)
committerAlan Cox <alan@linux.intel.com>
Tue, 26 Apr 2016 20:07:58 +0000 (21:07 +0100)
Applications/util/init.c

index 5dd0d68..c85b4e7 100644 (file)
@@ -735,7 +735,7 @@ static void spawn_login(struct passwd *pwd, const char *tty, const char *id)
        /* utmp */
        ut.ut_type = USER_PROCESS;
        ut.ut_pid = getpid();
-       strncpy(ut.ut_line, tty, UT_LINESIZE);
+       strncpy(ut.ut_line, tty+5, UT_LINESIZE);
        strncpy(ut.ut_id, id, 2);
        time(&ut.ut_time);
        strncpy(ut.ut_user, pwd->pw_name, UT_NAMESIZE);