Skip to content

Commit

Permalink
um: port_user: Allow setting path to port-helper using UML_PORT_HELPE…
Browse files Browse the repository at this point in the history
…R envvar

This is useful when the uml-utilities user-space package has not been
installed by the administrator and an unprivileged user wants to be able to
telnet into a UML instance. The user can install the port-helper binary to
a writable path and set UML_PORT_HELPER. Fallback to using hardcoded path to
port-helper if environment variable is not set.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
Glenn Washburn authored and Richard Weinberger committed Mar 11, 2022
1 parent 6e8f4b7 commit db8109a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/um/drivers/port_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,14 @@ static void port_pre_exec(void *arg)
int port_connection(int fd, int *socket, int *pid_out)
{
int new, err;
char *env;
char *argv[] = { "in.telnetd", "-L",
OS_LIB_PATH "/uml/port-helper", NULL };
struct port_pre_exec_data data;

if ((env = getenv("UML_PORT_HELPER")))
argv[2] = env;

new = accept(fd, NULL, 0);
if (new < 0)
return -errno;
Expand Down

0 comments on commit db8109a

Please sign in to comment.