Support for starting finit-getty with a given user

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2016-09-04 20:02:59 +02:00
1 parent 47f3e2ca04
commit 79207dcb22
2 files changed
+9 -5

No files matched your search

+6 -2
View File
@@ -268,7 +268,7 @@ static speed_t do_parse_speed(char *baud)
return B0;
}
int getty(char *tty, char *baud, char *UNUSED(term))
int getty(char *tty, char *baud, char *UNUSED(term), char *user)
{
int fd;
char name[30];
@@ -308,7 +308,11 @@ int getty(char *tty, char *baud, char *UNUSED(term))
stty(fd, speed);
utmp_set_login(tty, NULL);
do_getty(tty, name, sizeof(name));
if (!user)
do_getty(tty, name, sizeof(name));
else
strlcpy(name, user, sizeof(name));
return do_login(name);
}