!C99Shell v. 1.0 pre-release build #16!

Software: Apache/2.0.54 (Fedora). PHP/5.0.4 

uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 

uid=48(apache) gid=48(apache) groups=48(apache)
context=system_u:system_r:httpd_sys_script_t
 

Safe-mode: OFF (not secure)

/usr/lib/4Suite/tests/Xml/Xslt/Core/   drwxr-xr-x
Free 4.89 GB of 27.03 GB (18.11%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     test_extensions_1.py (2.26 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import os, sys
from Ft.Xml.Xslt import XsltElement, AttributeInfo

from Xml.Xslt import test_harness

class SystemElement(XsltElement):

    legalAttrs = {
        'command' : AttributeInfo.StringAvt(required=1),
        }
    def instantiate(self, context, processor):
        context.processorNss = self.namespaces
        context.currentInstruction = self
        command = self._command.evaluate(context)
        os.system(command)
        return (context,)


ExtElements = {
    ('http://foo.org/namespaces/ext-xslt', 'system'): SystemElement
    }


sheet_str_1 = """<?xml version="1.0"?>
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:ext="http://foo.org/namespaces/ext-xslt"
  extension-element-prefixes="ext"
  version="1.0">

  <xsl:template match="execute-command">
    <docelem>
    <ext:system command="{@cmd}"/>
    </docelem>
  </xsl:template>

</xsl:stylesheet>
"""

if sys.platform[:3] != 'win':
    xml_source_1 = """<execute-command cmd="touch 'foo'"/>"""
    xml_source_2 = """<execute-command cmd="rm -f 'foo'"/>"""
else:
    xml_source_1 = """<execute-command cmd="echo '1' > foo"/>"""
    xml_source_2 = """<execute-command cmd="del foo"/>"""
    
expected_1 = """<?xml version='1.0' encoding='UTF-8'?>
<docelem/>
"""
expected_2 = expected_1


def Test(tester):

    tester.startGroup("Test 1")

    # make sure there is a clean slate
    if os.path.exists("foo"):
        os.unlink("foo")

    source = test_harness.FileInfo(string=xml_source_1)
    sty = test_harness.FileInfo(string=sheet_str_1)
    test_harness.XsltTest(tester, source, [sty], expected_1,
                          extensionModules=[__name__])
    tester.startTest("Test extension element result")
    tester.compare(1, os.path.exists("foo"))
    tester.testDone()
    tester.groupDone()


    tester.startGroup("Test 2")
    source = test_harness.FileInfo(string=xml_source_2)
    sty = test_harness.FileInfo(string=sheet_str_1)
    test_harness.XsltTest(tester, source, [sty], expected_2,
                          extensionModules=[__name__])
    tester.startTest("Test extension element result")
    tester.compare(0, os.path.exists("foo"))
    tester.testDone()
    tester.groupDone()

    # cleanup after ourselves
    if os.path.exists("foo"):
        os.unlink("foo")

    return

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0031 ]--