summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-19 14:07:01 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-19 14:07:01 +0000
commit04297853c0804cada299bf233f760d9debc01a25 (patch)
tree8428c574d2d43c932cc3cb258136f21e73376785 /t
parent495c59efb1522699f978cabe28b42adf9014f492 (diff)
Ensure that hostnames used for ping-tests are valid - to avoid the security hole.
Diffstat (limited to 't')
-rwxr-xr-xt/test-parser.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/test-parser.rb b/t/test-parser.rb
index a037448..cb9a9cb 100755
--- a/t/test-parser.rb
+++ b/t/test-parser.rb
@@ -608,4 +608,24 @@ class TestParser < Test::Unit::TestCase
end
end
+
+ #
+ # Test the potential security-hole for ping-tests
+ #
+ def test_ping_security_hole
+
+
+ parser = MonitorConfig.new("/dev/null" )
+
+ assert_raise ArgumentError do
+ parser.parse_line( "$(/tmp/exploit) must ping ." )
+ end
+
+ assert_nothing_raised do
+ parser.parse_line( "test.example.vm.bytemark.co.uk must ping ." )
+ end
+
+ end
+
+
end