From 5a33f412d9ee2baaff028bf670ca757b3e194c09 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Wed, 12 Dec 2012 21:24:51 +0100 Subject: [PATCH] kmscon: use /bin/login -p as default login program We must pass "-p" to make "login" preserve the environment. We make sure the environment is correctly reset before calling it so it is safe. Furthermore, this allows us to pass additional environment variables to the child without having /bin/login reset it. Signed-off-by: David Herrmann --- docs/man/kmscon.xml | 2 +- src/kmscon_conf.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/man/kmscon.xml b/docs/man/kmscon.xml index b2d961b..c337872 100644 --- a/docs/man/kmscon.xml +++ b/docs/man/kmscon.xml @@ -224,7 +224,7 @@ after all options have been parsed is used as argument to this option. Note that nothing after two dashes is parsed as regular option by kmscon. - (default: /bin/login) + (default: /bin/login -p) This example starts '/bin/bash -i' on each new terminal session: ./kmscon --login --debug --no-switchvt -- /bin/bash -i diff --git a/src/kmscon_conf.c b/src/kmscon_conf.c index 3cc7c0b..6ce5714 100644 --- a/src/kmscon_conf.c +++ b/src/kmscon_conf.c @@ -82,7 +82,7 @@ static void print_help() "\t --cdev-session [off] Enable kernel VT emulation session\n" "\n" "Terminal Options:\n" - "\t-l, --login [/bin/sh]\n" + "\t-l, --login [/bin/login -p]\n" "\t Start the given login process instead\n" "\t of the default process; all arguments\n" "\t following '--' will be be parsed as\n" @@ -230,7 +230,7 @@ static const struct conf_type conf_vt = { * special handling that the command-line does. */ -static char *def_argv[] = { "/bin/login", NULL }; +static char *def_argv[] = { "/bin/login", "-p", NULL }; static void conf_default_login(struct conf_option *opt) {