Codejail cannot run without a user set
还没有人认领这个 Issue。
评估
调研方向
从 jail_code.py 开始,检查在 subprocess.Popen 运行命令之前命令列表是如何组装的,尤其是在未配置 user 时。将 user 选项取消设置后重现 jailed execution,然后确定预期的解决方案是修正命令构造,还是将 user 设为必填项。选定的行为能够一致地工作,并且由相关的现有测试覆盖时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
If codejail is not configured with a user to run commands as, jailed code execution will fail. Effectively, this makes the user config option mandatory rather than optional.
This probably hasn't come up much because most users would configure it with a user. One possibility is to just make the option mandatory.
Details:
jail_code.py builds up a list to pass to subprocess.Popen. This is run as a command with arguments, rather than a shell command string. However, one of the arguments is 'TMPDIR=tmp', a construction to set an environment variable for a process in Bash. TMPDIR=tmp python ... works fine in Bash, but subprocess.Popen(['TMPDIR=tmp', 'python', ...]) does not work because TMPDIR=tmp is not a valid executable.
The reason it works with a user configured is that the command array will then first be prefixed with ['sudo', '-u', user]. The sudo command interprets the remainder of its arguments as a shell string rather than a command and arguments.
- 主要语言
- Python
- 星标
- 477
- 派生
- 83
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 6
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
openedx/codejail 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 35/100
-
Stop using global state to store configuration options可能重新可做 关联的 PR 已关闭且未合并。 未关闭code health
难度 5/5 一周以上 新手友好度 25/100
-
难度 3/5 1-2 天 新手友好度 30/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 3/5 1-2 天 新手友好度 35/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 64/100
-
难度 2/5 1-3 小时 新手友好度 76/100
btclib-org/btclib-wallet#1045 ·
维护者通常 1 天内回复
-
area-templates triage:bot-seen triage:needs-human
难度 2/5 1-3 小时 新手友好度 75/100
microsoft/aspire#22356 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
[Train] An elastic ScalingConfig(num_workers=(0, 0)) is accepted and the run waits forever可能已有人在做 @wguo7 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
ray-project/ray#68217 ·
维护者通常 2 天内回复