Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 33 lines (26 sloc) 0.777 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
from base import *

FILE = 'special_file_for_179'
MAGIC = 'Alvaro: http://www.alobbs.com/'

CONF = """
vserver!1!rule!1790!match = exists
vserver!1!rule!1790!match!exists = %s
vserver!1!rule!1790!match!final = 1
vserver!1!rule!1790!handler = cgi
""" % (FILE)

CGI_BASE = """#!/bin/sh
echo "Content-type: text/html"
echo ""
cat << EOF
%s
EOF
"""

class Test (TestBase):
    def __init__ (self):
        TestBase.__init__ (self, __file__)
        self.name = "Rule Exists: match"
        self.request = "GET /%s HTTP/1.0\r\n" % (FILE)
        self.forbidden_content = ['/bin/sh', 'echo']
        self.expected_error = 200
        self.conf = CONF

    def Prepare (self, www):
        self.WriteFile (www, FILE, 0555, CGI_BASE % (MAGIC))

Something went wrong with that request. Please try again.