gpt4 book ai didi

python - Flask: fork 环境

转载 作者:太空狗 更新时间:2023-10-29 20:58:54 25 4
gpt4 key购买 nike

Flask-Quick Start 浏览 Flask 文档时我看到了以下段落。

Attention

Even though the interactive debugger does not work in forking environments (which makes it nearly impossible to use on production servers), it still allows the execution of arbitrary code. This makes it a major security risk and therefore it must never be used on production machines.

我搜索了 stackoverflow、google,但我无法找到这些“ fork 环境”是什么,以及它们如何允许执行任意代码。如果有人能给我指出正确的方向,那就太好了!

最佳答案

前面的句子是这样的:

If you enable debug support the server will reload itself on code changes, and it will also provide you with a helpful debugger if things go wrong.

正是这个有用的调试器允许执行任意代码;它通过网络接受 Python 代码,并可以在您的服务器上为您执行该任意代码。

它说,不要在生产服务器上启用 Debug模式。

关于 fork 环境的部分只是告诉您提供的调试器在进程 fork 时不起作用(例如,使用多个进程处理请求),但您不应该误以为安全。即使调试器在此类环境中出现故障,它的故障也不足以禁用 Python 执行功能。

关于python - Flask: fork 环境,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21558463/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com