Edgewall Software

Changes between Initial Version and Version 1 of Ticket #12403, comment 1


Ignore:
Timestamp:
Mar 16, 2016, 3:41:31 AM (8 years ago)
Author:
Jun Omae

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12403, comment 1

    initial v1  
    1818It seems `os.exec*` family disallows null bytes.
    1919{{{
     20$ LANG=C python -c "import os; os.execv('/bin/echo', ('/bin/echo', '123'))"
     21123
    2022$ LANG=C python -c "import os; os.execv('/bin/echo', ('/bin/echo', '1\x0023'))"
    2123Traceback (most recent call last):
    2224  File "<string>", line 1, in <module>
    2325TypeError: execv() arg 2 must contain only strings
     26$
     27$ LANG=en_US.UTF-8 python -c "import os; os.execv('/bin/echo', ('/bin/echo', '123'))"
     28123
    2429$ LANG=en_US.UTF-8 python -c "import os; os.execv('/bin/echo', ('/bin/echo', '1\x0023'))"
    2530Traceback (most recent call last):