mirror of
https://github.com/troglobit/finit.git
synced 2026-10-12 10:12:32 +00:00
Remove fallback to /bin/sh if no TTY is defined
If the user specifies no 'tty /dev/ttyN' in finit.conf this code took upon itself to add a backdoor to the system. Let's remove it and rely on the operator deciding what is best practise. With this patch no getty, or fallback shell, will be started if no tty line in finit.conf is available. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -499,28 +499,10 @@ void conf_reload_dynamic(void)
|
||||
|
||||
int conf_parse_config(void)
|
||||
{
|
||||
int result;
|
||||
|
||||
username = strdup(DEFUSER);
|
||||
hostname = strdup(DEFHOST);
|
||||
|
||||
result = parse_conf(FINIT_CONF);
|
||||
if (!tty_num()) {
|
||||
char *fallback = NULL;
|
||||
|
||||
if (console)
|
||||
fallback = console;
|
||||
else
|
||||
fallback = strdup(FALLBACK_SHELL);
|
||||
|
||||
if (tty_register(fallback))
|
||||
_pe("Failed registering fallback TTY");
|
||||
|
||||
if (!console)
|
||||
free(fallback);
|
||||
}
|
||||
|
||||
return result;
|
||||
return parse_conf(FINIT_CONF);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user