Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
2bce24fc
Commit
2bce24fc
authored
Dec 16, 2013
by
Leigh B Stoller
Browse files
Add securelocalmode flag (-e) to disable telnet escape character.
parent
85dbe85f
Changes
1
Hide whitespace changes
Inline
Side-by-side
tip/tiptunnel.c
View file @
2bce24fc
/*
* 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
*
...
...
@@ -161,6 +161,7 @@ int main( int argc, char ** argv )
char
*
aclfile
=
(
char
*
)
NULL
;
int
op
;
int
oldflags
;
int
securelocalmode
=
0
;
struct
termios
tios
;
#if defined(LOCALBYDEFAULT) || defined(TIPPTY)
...
...
@@ -170,7 +171,7 @@ int main( int argc, char ** argv )
#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
)
{
case
'h'
:
usage
(
name
);
...
...
@@ -181,6 +182,9 @@ int main( int argc, char ** argv )
case
'l'
:
localmode
++
;
break
;
case
'e'
:
securelocalmode
++
;
break
;
case
'p'
:
tunnelPort
=
atoi
(
optarg
);
break
;
...
...
@@ -376,11 +380,14 @@ int main( int argc, char ** argv )
if
(
localmode
)
{
if
(
!
fork
())
{
char
*
foo
[
4
];
foo
[
0
]
=
"telnet"
;
foo
[
1
]
=
"localhost"
;
foo
[
2
]
=
portString
;
foo
[
3
]
=
NULL
;
char
*
foo
[
5
],
**
fp
=
foo
;
*
fp
++
=
"telnet"
;
if
(
securelocalmode
)
*
fp
++
=
"-E"
;
*
fp
++
=
"localhost"
;
*
fp
++
=
portString
;
*
fp
++
=
NULL
;
execvp
(
"telnet"
,
foo
);
exit
(
666
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment