Commit 58c65a1a authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Add some JAILED() tests to prevent jailed nodes from doing Shashi

code (asking tmcd twice for routes, ifconfig, etc). Shashi will fix
later.
parent 24026065
...@@ -1886,7 +1886,7 @@ sub dotrafficconfig() ...@@ -1886,7 +1886,7 @@ sub dotrafficconfig()
# storing the output of a few tmcc commands in # storing the output of a few tmcc commands in
# $BOOTDIR files for use by NSE # $BOOTDIR files for use by NSE
# #
if (! REMOTE()) { if (!REMOTE() && !JAILED()) {
open(BOSSINFCFG, ">$BOOTDIR/tmcc.bossinfo") or open(BOSSINFCFG, ">$BOOTDIR/tmcc.bossinfo") or
die "Cannot open file $BOOTDIR/tmcc.bossinfo: $!"; die "Cannot open file $BOOTDIR/tmcc.bossinfo: $!";
print BOSSINFCFG "$bossinfo"; print BOSSINFCFG "$bossinfo";
...@@ -1917,7 +1917,7 @@ sub dotrafficconfig() ...@@ -1917,7 +1917,7 @@ sub dotrafficconfig()
# Also nse stuff is mixed up with traffic config right # Also nse stuff is mixed up with traffic config right
# now because of having FullTcp based traffic generation. # now because of having FullTcp based traffic generation.
# Needs to move to a different place # Needs to move to a different place
if (! REMOTE()) { if (!REMOTE() && !JAILED()) {
my $record_sep; my $record_sep;
$record_sep = $/; $record_sep = $/;
...@@ -1942,7 +1942,7 @@ sub dotrafficconfig() ...@@ -1942,7 +1942,7 @@ sub dotrafficconfig()
while (<$TM>) { while (<$TM>) {
if (! REMOTE()) { if (!REMOTE() && !JAILED()) {
print TRAFCFG "$_"; print TRAFCFG "$_";
} }
if ($_ =~ /$pat/) { if ($_ =~ /$pat/) {
...@@ -2001,7 +2001,7 @@ sub dotrafficconfig() ...@@ -2001,7 +2001,7 @@ sub dotrafficconfig()
warn "*** WARNING: Bad traffic line: $_"; warn "*** WARNING: Bad traffic line: $_";
} }
} }
if (! REMOTE()) { if (!REMOTE() && !JAILED()) {
close(TRAFCFG); close(TRAFCFG);
} }
...@@ -2015,7 +2015,7 @@ sub dotrafficconfig() ...@@ -2015,7 +2015,7 @@ sub dotrafficconfig()
# storing the output of a few tmcc commands in # storing the output of a few tmcc commands in
# $BOOTDIR files for use by NSE # $BOOTDIR files for use by NSE
# #
if (! REMOTE()) { if (!REMOTE() && !JAILED()) {
open(NSECFG, ">$BOOTDIR/tmcc.nseconfigs") or open(NSECFG, ">$BOOTDIR/tmcc.nseconfigs") or
die "Cannot open file $BOOTDIR/tmcc.nseconfigs: $!"; die "Cannot open file $BOOTDIR/tmcc.nseconfigs: $!";
$TM = OPENTMCC(TMCCCMD_NSECONFIGS); $TM = OPENTMCC(TMCCCMD_NSECONFIGS);
......
...@@ -1886,7 +1886,7 @@ sub dotrafficconfig() ...@@ -1886,7 +1886,7 @@ sub dotrafficconfig()
# storing the output of a few tmcc commands in # storing the output of a few tmcc commands in
# $BOOTDIR files for use by NSE # $BOOTDIR files for use by NSE
# #
if (! REMOTE()) { if (!REMOTE() && !JAILED()) {
open(BOSSINFCFG, ">$BOOTDIR/tmcc.bossinfo") or open(BOSSINFCFG, ">$BOOTDIR/tmcc.bossinfo") or
die "Cannot open file $BOOTDIR/tmcc.bossinfo: $!"; die "Cannot open file $BOOTDIR/tmcc.bossinfo: $!";
print BOSSINFCFG "$bossinfo"; print BOSSINFCFG "$bossinfo";
...@@ -1917,7 +1917,7 @@ sub dotrafficconfig() ...@@ -1917,7 +1917,7 @@ sub dotrafficconfig()
# Also nse stuff is mixed up with traffic config right # Also nse stuff is mixed up with traffic config right
# now because of having FullTcp based traffic generation. # now because of having FullTcp based traffic generation.
# Needs to move to a different place # Needs to move to a different place
if (! REMOTE()) { if (!REMOTE() && !JAILED()) {
my $record_sep; my $record_sep;
$record_sep = $/; $record_sep = $/;
...@@ -1942,7 +1942,7 @@ sub dotrafficconfig() ...@@ -1942,7 +1942,7 @@ sub dotrafficconfig()
while (<$TM>) { while (<$TM>) {
if (! REMOTE()) { if (!REMOTE() && !JAILED()) {
print TRAFCFG "$_"; print TRAFCFG "$_";
} }
if ($_ =~ /$pat/) { if ($_ =~ /$pat/) {
...@@ -2001,7 +2001,7 @@ sub dotrafficconfig() ...@@ -2001,7 +2001,7 @@ sub dotrafficconfig()
warn "*** WARNING: Bad traffic line: $_"; warn "*** WARNING: Bad traffic line: $_";
} }
} }
if (! REMOTE()) { if (!REMOTE() && !JAILED()) {
close(TRAFCFG); close(TRAFCFG);
} }
...@@ -2015,7 +2015,7 @@ sub dotrafficconfig() ...@@ -2015,7 +2015,7 @@ sub dotrafficconfig()
# storing the output of a few tmcc commands in # storing the output of a few tmcc commands in
# $BOOTDIR files for use by NSE # $BOOTDIR files for use by NSE
# #
if (! REMOTE()) { if (!REMOTE() && !JAILED()) {
open(NSECFG, ">$BOOTDIR/tmcc.nseconfigs") or open(NSECFG, ">$BOOTDIR/tmcc.nseconfigs") or
die "Cannot open file $BOOTDIR/tmcc.nseconfigs: $!"; die "Cannot open file $BOOTDIR/tmcc.nseconfigs: $!";
$TM = OPENTMCC(TMCCCMD_NSECONFIGS); $TM = OPENTMCC(TMCCCMD_NSECONFIGS);
......
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