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 天內回覆