【发布时间】:2021-04-20 05:24:07
【问题描述】:
我正在使用 Python 生成 ImageMagick bash 命令。类似的东西
import subprocess
input_file = "hello.png"
output_file = "world.jpg"
subprocess.run(["convert", input_file, output_file])
input_file 或output_file 之前可能有更多参数。我的问题是,如果其中一个文件名是用户提供的,并且用户提供了一个可以解析为 ImageMagick 的命令行选项的文件名,那不是不安全吗?
【问题讨论】:
标签: python bash imagemagick