mirror of
https://github.com/troglobit/finit.git
synced 2026-10-12 10:12:32 +00:00
UTMP: Set LOGIN_PROCESS for built-in getty
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include "finit.h"
|
||||
#include "helpers.h"
|
||||
#include "sig.h"
|
||||
#include "utmp-api.h"
|
||||
|
||||
#ifndef _PATH_LOGIN
|
||||
#define _PATH_LOGIN "/bin/login"
|
||||
@@ -305,7 +306,7 @@ int getty(char *tty, char *baud, char *UNUSED(term))
|
||||
sigaction(SIGQUIT, &sa, NULL);
|
||||
|
||||
stty(fd, speed);
|
||||
// do_utmp();
|
||||
utmp_set_login(tty, NULL);
|
||||
|
||||
do_getty(tty, name, sizeof(name));
|
||||
return do_login(name);
|
||||
|
||||
+12
-2
@@ -77,7 +77,7 @@ int utmp_set_halt(void)
|
||||
return utmp_set(RUN_LVL, 0, NULL, NULL, "shutdown");
|
||||
}
|
||||
|
||||
int utmp_set_init(char *tty, char *id)
|
||||
static int set_getty(int type, char *tty, char *id)
|
||||
{
|
||||
char *line;
|
||||
|
||||
@@ -94,7 +94,17 @@ int utmp_set_init(char *tty, char *id)
|
||||
id += 4;
|
||||
}
|
||||
|
||||
return utmp_set(INIT_PROCESS, getpid(), line, id, NULL);
|
||||
return utmp_set(type, getpid(), line, id, NULL);
|
||||
}
|
||||
|
||||
int utmp_set_init(char *tty, char *id)
|
||||
{
|
||||
return set_getty(INIT_PROCESS, tty, id);
|
||||
}
|
||||
|
||||
int utmp_set_login(char *tty, char *id)
|
||||
{
|
||||
return set_getty(LOGIN_PROCESS, tty, id);
|
||||
}
|
||||
|
||||
int utmp_set_dead(int pid)
|
||||
|
||||
@@ -25,6 +25,7 @@ int utmp_set (int type, int pid, char *line, char *id, char *user);
|
||||
int utmp_set_boot (void);
|
||||
int utmp_set_halt (void);
|
||||
int utmp_set_init (char *tty, char *id);
|
||||
int utmp_set_login (char *tty, char *id);
|
||||
int utmp_set_dead (int pid);
|
||||
int utmp_set_runlevel(int pre, int now);
|
||||
int utmp_show (char *file);
|
||||
|
||||
Reference in New Issue
Block a user