Repository navigation
fix: create private runtime dir atomically - #923
Merged
Merged
Conversation
ensure_private_dir checked exists() and then called create_dir, so two orx processes or test threads creating /tmp/orx-<uid> together could fail with EEXIST. A loser could also see the directory before its chmod and reject it as unsafe. This failed the v0.2.25 release CI twice in remote_host discovery tests. Create the directory with mode 0700, and on AlreadyExists verify the existing one with the same safety checks. Assisted-by: claude-opus-5.5
Contributor
[Medium impact] This PR appears safe to merge. SummaryCreates the Unix runtime directory with private permissions in one step.
No actionable issues found. Tests were inspected but not run during this review. Reviews (1) · Last reviewed commit: "fix: create private runtime dir atomical..." · Reviewed by Greptile |
1 task
qianyuliu
pushed a commit
to CMCC-AI/OpenResearch
that referenced
this pull request
Nov 16, 2026
- 在 src/local/chat/mod.rs 的 set_chat_session_env 中统一将 ORX_DATA_DIR 锚定到当前仪表盘规范化数据目录,并收敛各 harness 调用点(alphaXiv#962) - 在 src/output.rs 与 src/main.rs 捕获短生命周期 CLI 的 stdout BrokenPipe 并安静退出,在只读查询命令中新增 Store::open_for_reading 降级支持(alphaXiv#962) - 在 src/commands/remote_host.rs 使用 DirBuilder::mode(0o700) 原子创建私有运行时目录并在 AlreadyExists 时校验权限归属(alphaXiv#923) - 在 src/compute.rs 为 git archive 注入 core.autocrlf=false 与 core.eol=lf,在 ui/src/markdownTarget.ts 兼容字面量百分号文件名并重编 ui/dist(alphaXiv#730、alphaXiv#786)
qianyuliu
pushed a commit
to CMCC-AI/OpenResearch
that referenced
this pull request
Nov 17, 2026
- 更新 `releases.md` 与 `release-notes/v0.2.24-mobilesci.1.md`,完整反映 `.7.1` 后新增能力、阶段 1/2 加固及 `hosted-local` 启动器状态 - 刷新 `upstream-v0.2.24-backports.md` 与 `upstream-v0.2.25-review-2026-11-09.md` 回移台账,标注已适配落地的 `alphaXiv#985`/`alphaXiv#952`/`alphaXiv#981`/`alphaXiv#990`/`alphaXiv#962`/`alphaXiv#923`/`alphaXiv#730`/`alphaXiv#786`/`alphaXiv#909`/`alphaXiv#747`/`alphaXiv#903` - 补充 `start-mobilesci.md` 与 `runtime-and-deployment.md` 中的本地多用户托管模式(5400)说明,消除文档与仓库入口漂移 - 修订 `next-cycle-plan.md`,明确 Gate 1 发版上线与 Phase 3 增量重构、上游按需跟踪及重型需求准入边界
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The v0.2.25 release CI failed twice in
remote_host::discovery_tests, once on aarch64 (42312029741) and once on x86_64 (42316412615). Both timesdescriptor.publish(...)returnedFile exists (os error 17).ensure_private_dircreates/tmp/orx-<uid>. It checkedexists()and then calledcreate_dir, so when concurrent callers raced on a fresh machine, the losers gotEEXIST. A loser could also see the new directory before itschmod 0700and reject it as unsafe. Two orx processes starting together could hit the same race, not just tests.The directory is now created at mode 0700 in one step. On
AlreadyExists, the existing directory goes through the same symlink, type, owner and mode checks. The rules for what counts as safe are unchanged. A dangling symlink now gets the "Unsafe" message instead of a rawEEXIST. Both IO errors now carry the path.A sweep of
src/andcrates/found no otherexists()-guardedcreate_dirorcreate_new. The Windows branch ofruntime_pathusescreate_dir_alland is unaffected.concurrent_callers_all_get_one_private_runtime_dir(16 threads on a barrier) failed 3 of 3 runs against the old function and passed 5 of 5 with the fixcargo fmt --check,cargo clippy -D warnings,cargo build --locked,cargo test --locked: 1725 unit tests passed. Thetests/sshd.rslatency test failed once under load and passed 3 of 3 alone; it is unrelated.Assisted-by: claude-opus-5.5