pty: use /bin/login by default

kmscon does always pass a proper argv array so the default is never used.
However, for security reasons we shouldn't hardcode /bin/login. If some
other program uses the pty layer and forgets to pass in a suitable argv
all the time, they mind end up with opening a root shell.

Hence, use /bin/login as default.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2012-12-09 18:33:03 +01:00
parent 978b869e8b
commit b78244e1ab

View File

@ -201,7 +201,7 @@ exec_child(const char *term, char **argv, const char *seat)
if (!term)
term = "vt220";
if (!argv)
argv = (char*[]){ "/bin/sh", "-l", NULL };
argv = (char*[]){ "/bin/login", NULL };
setenv("TERM", term, 1);
if (seat)