kmscon: use /bin/login -p as default login program
authorDavid Herrmann <dh.herrmann@googlemail.com>
Wed, 12 Dec 2012 20:24:51 +0000 (21:24 +0100)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Wed, 12 Dec 2012 20:24:51 +0000 (21:24 +0100)
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 <dh.herrmann@googlemail.com>
docs/man/kmscon.xml
src/kmscon_conf.c

index b2d961b..c337872 100644 (file)
                 after all options have been parsed is used as argument to this
                 option. Note that nothing after two dashes <option>--</option>
                 is parsed as regular option by kmscon.
-                (default: /bin/login)</para>
+                (default: /bin/login -p)</para>
 
           <para>This example starts '/bin/bash -i' on each new terminal session:
                 ./kmscon --login --debug --no-switchvt -- /bin/bash -i</para>
index 3cc7c0b..6ce5714 100644 (file)
@@ -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)
 {