mirror of
https://github.com/troglobit/finit.git
synced 2026-10-22 11:36:07 +00:00
Support for starting finit-getty with a given user
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
47f3e2ca04
commit
79207dcb22
2 files changed
+9
-5
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user