host ensure fails with EACCES for a second OS user: senpi-rpc-host-locks is shared across users
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, typescript
Research direction
Start in the modes/rpc host lifecycle code where the lock path is built with join(tmpdir(), "senpi-rpc-host-locks", createSocketLockName(socket)); that is the only place the path is derived. Decide the per-user root first: $XDG_RUNTIME_DIR when set, otherwise <tmpdir>/senpi-rpc-host-locks-<uid>, created 0700 with an ownership/stat check before reuse. Find the existing tests around the host-ensure path and add a case with two distinct lock roots, or one root plus a foreign-owner check. Done means a second OS user's host ensure succeeds while the first user's directory exists, and no foreign-owned directory is written to.
Written by the indexing model from the issue text.
Description
Summary
senpi host ensure puts its socket lock at join(os.tmpdir(), "senpi-rpc-host-locks", <socket lock name>). The directory is shared by every OS user on the machine. The first user creates it with mode 0700, so every other user's host ensure (and omo daemon run on top of it) fails with EACCES and no host starts.
Reproduction
- On one Linux machine, user A runs
omo daemon run(any build that ensures a host)./tmp/senpi-rpc-host-locksis created, owned by A, modedrwx------. - User B, with its own HOME and agent dir and
TMPDIRunset, runsomo daemon run --json.
Expected
Each OS user gets its own lock directory, so B's host starts. For example, put it under $XDG_RUNTIME_DIR when that is set, else a per-uid directory such as <tmpdir>/senpi-rpc-host-locks-<uid>, created 0700 and checked for ownership before use.
Actual
{"action":"error","reason":"host_error","detail":"EACCES: permission denied, open '/tmp/senpi-rpc-host-locks/<hash>'"}
ls -ld /tmp/senpi-rpc-host-locks → drwx------ <user A> <user A>.
It shows up wherever a second account runs omo on the same machine: a service account, a test user, or a second person on a shared box. A systemd --user unit for user B fails on every start and restarts forever.
Workaround
Give user B its own TMPDIR; for a systemd user unit, systemctl --user set-environment TMPDIR=<dir> before the unit starts. With that, B's host starts normally.
Root cause
The lock path is built from tmpdir() only (modes/rpc host lifecycle: join(tmpdir(), "senpi-rpc-host-locks", createSocketLockName(socket))), with no per-user part.
Acceptance
- The lock directory is per OS user, and a second user's
host ensuresucceeds while another user's lock directory exists. - An existing directory owned by another user is never written to or trusted.
- A test with two lock roots, or one root plus an ownership check.
Related
- #2754 (lock files in the same directory are never removed): the same directory, a different defect.
- Dominant language
- TypeScript
- Stars
- 517
- Forks
- 163
- Avg merge
- 23h 31m
- Merged PRs (30d)
- 700
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from code-yeongyu/senpi
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
code-yeongyu/senpi#6813 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 66/100
code-yeongyu/senpi#6746 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
code-yeongyu/senpi#6742 ·
Maintainers usually reply within 1 day
-
[review-low] code-yeongyu/senpi#6726: glob error text for plain and '..' patterns, and UNC prefixesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
code-yeongyu/senpi#6734 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
code-yeongyu/senpi#6723 ·
Maintainers usually reply within 1 day
All issues in code-yeongyu/senpi
Similar issues
-
bug(core): JsonOutputKeyToolsParser ignores returnId: truePossibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
langchain-ai/langchainjs#12239 ·
Maintainers usually reply within 1 day
-
Board view: the Monitoring column is always empty because compact issue rows drop displayStatusOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100
paperclipai/paperclip#21837 ·
Maintainers usually reply within 1 day
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 93/100
lingdojo/kana-dojo#34169 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100