Пример #1
0
 def test_parsers_fix_unsafe(self):
     """Test that unsafe inputs are quoted out and then ignored."""
     shell_input = "\"&coproc /bin/sh\""
     fixed = _parsers._fix_unsafe(shell_input)
     print(fixed)
     test_file = os.path.join(_files, 'cypherpunk_manifesto')
     self.assertTrue(os.path.isfile(test_file))
     has_shell = self.gpg.verify_file(test_file, fixed)
     self.assertFalse(has_shell.valid)
Пример #2
0
 def test_parsers_fix_unsafe(self):
     """Test that unsafe inputs are quoted out and then ignored."""
     shell_input = "\"&coproc /bin/sh\""
     fixed = _parsers._fix_unsafe(shell_input)
     print(fixed)
     test_file = os.path.join(_files, 'cypherpunk_manifesto')
     self.assertTrue(os.path.isfile(test_file))
     has_shell = self.gpg.verify_file(test_file, fixed)
     self.assertFalse(has_shell.valid)
Пример #3
0
 def test_parsers_fix_unsafe_semicolon(self):
     """Test that we can't escape into the Python interpreter."""
     shell_input = "; import antigravity ;"
     fixed = _parsers._fix_unsafe(shell_input)
Пример #4
0
 def test_parsers_fix_unsafe_semicolon(self):
     """Test that we can't escape into the Python interpreter."""
     shell_input = "; import antigravity ;"
     fixed = _parsers._fix_unsafe(shell_input)