From bfe9e011bdd6ab6b98ab29211834f0fb4cbdaf38 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Wed, 27 Jul 2016 19:14:36 +0200 Subject: [PATCH] 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 --- conf.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/conf.c b/conf.c index 6e13666a..54ac50fb 100644 --- a/conf.c +++ b/conf.c @@ -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); } /**