Skip to content

Commit db8109a

Browse files
crassrichardweinberger
authored andcommitted
um: port_user: Allow setting path to port-helper using UML_PORT_HELPER 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>
1 parent 6e8f4b7 commit db8109a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

arch/um/drivers/port_user.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,14 @@ static void port_pre_exec(void *arg)
167167
int port_connection(int fd, int *socket, int *pid_out)
168168
{
169169
int new, err;
170+
char *env;
170171
char *argv[] = { "in.telnetd", "-L",
171172
OS_LIB_PATH "/uml/port-helper", NULL };
172173
struct port_pre_exec_data data;
173174

175+
if ((env = getenv("UML_PORT_HELPER")))
176+
argv[2] = env;
177+
174178
new = accept(fd, NULL, 0);
175179
if (new < 0)
176180
return -errno;

0 commit comments

Comments
 (0)