Message336094
> Sure we don't want to execute these kinds of scripts but we could mix with GetBinaryTypeW and add a check on the extensions.
Windows has a convenient feature: if you ask to run "program", Windows tries to run "program.exe", "program.bat", etc.
Example:
---
C:\vstinner>del hello.txt
C:\vstinner>type hello.bat
echo "Hello from hello.bat" > /vstinner/hello.txt
C:\vstinner>\vstinner\python\master\python
Python 3.8.0a0 (heads/master:8f59ee01be, Jan 25 2019, 01:16:59) [MSC v.1915 64 bit (AMD64)] on win32
>>> import os
>>> os.startfile(r"c:\vstinner\hello")
>>> with open(r"c:\vstinner\hello.txt") as fp: print(fp.read())
...
"Hello from hello.bat"
---
os.startfile(r"c:\vstinner\hello") <= "hello" filename has no extension |
|
Date |
User |
Action |
Args |
2019-02-20 14:48:53 | vstinner | set | recipients:
+ vstinner, paul.moore, tim.golden, zach.ware, eryksun, steve.dower, matrixise, mdk |
2019-02-20 14:48:53 | vstinner | set | messageid: <1550674133.61.0.409206569904.issue36021@roundup.psfhosted.org> |
2019-02-20 14:48:53 | vstinner | link | issue36021 messages |
2019-02-20 14:48:53 | vstinner | create | |
|