All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit 2bce24fc authored by Leigh B Stoller's avatar Leigh B Stoller

Add securelocalmode flag (-e) to disable telnet escape character.

parent 85dbe85f
/* /*
* Copyright (c) 2004, 2005, 2006 University of Utah and the Flux Group. * Copyright (c) 2004-2013 University of Utah and the Flux Group.
* *
* {{{EMULAB-LICENSE * {{{EMULAB-LICENSE
* *
...@@ -161,6 +161,7 @@ int main( int argc, char ** argv ) ...@@ -161,6 +161,7 @@ int main( int argc, char ** argv )
char * aclfile = (char *) NULL; char * aclfile = (char *) NULL;
int op; int op;
int oldflags; int oldflags;
int securelocalmode = 0;
struct termios tios; struct termios tios;
#if defined(LOCALBYDEFAULT) || defined(TIPPTY) #if defined(LOCALBYDEFAULT) || defined(TIPPTY)
...@@ -170,7 +171,7 @@ int main( int argc, char ** argv ) ...@@ -170,7 +171,7 @@ int main( int argc, char ** argv )
#endif #endif
#endif #endif
while ((op = getopt( argc, argv, "hlp:rdu:c:a:os:" )) != -1) { while ((op = getopt( argc, argv, "hlp:rdu:c:a:os:e" )) != -1) {
switch (op) { switch (op) {
case 'h': case 'h':
usage(name); usage(name);
...@@ -181,6 +182,9 @@ int main( int argc, char ** argv ) ...@@ -181,6 +182,9 @@ int main( int argc, char ** argv )
case 'l': case 'l':
localmode++; localmode++;
break; break;
case 'e':
securelocalmode++;
break;
case 'p': case 'p':
tunnelPort = atoi( optarg ); tunnelPort = atoi( optarg );
break; break;
...@@ -376,11 +380,14 @@ int main( int argc, char ** argv ) ...@@ -376,11 +380,14 @@ int main( int argc, char ** argv )
if (localmode) { if (localmode) {
if (!fork()) { if (!fork()) {
char * foo[4]; char *foo[5], **fp = foo;
foo[0] = "telnet";
foo[1] = "localhost"; *fp++ = "telnet";
foo[2] = portString; if (securelocalmode)
foo[3] = NULL; *fp++ = "-E";
*fp++ = "localhost";
*fp++ = portString;
*fp++ = NULL;
execvp( "telnet", foo ); execvp( "telnet", foo );
exit(666); exit(666);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment