oxidecomputer / oxidecomputer/omicron

wicket: /tmp/wicket.log has wrong owner (chown) after running wicket as root from within the switch zone

Open
#10,004 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
572
Forks
97
Avg merge
2d 12h
Merged PRs (30d)
96

Description

I tried to ssh into wicket from the outside, and I got:

Error: error opening log file /tmp/wicket.log

Caused by:
    Permission denied (os error 13)

This was due to:

root@oxz_switch1:~# ls -la /tmp/wicket.log 
-rw-r--r--   1 root     root       40391 Mar  7 22:36 /tmp/wicket.log

This fixed the issue:

root@oxz_switch1:~# chown wicket:wicket /tmp/wicket.log 
root@oxz_switch1:~# ls -la /tmp/wicket.log 
-rw-r--r--   1 wicket   wicket     40391 Mar  7 22:36 /tmp/wicket.log

The owner of /tmp/wicket.log can be root under the following circumstances, where /tmp/wicket.log is not present before running wicket:

root@oxz_switch0:~# rm /tmp/wicket.log
root@oxz_switch0:~# /opt/oxide/wicket/bin/wicket
root@oxz_switch0:~# ls -la /tmp/wicket.log 
-rw-r--r--   1 root     root     1719133 Mar  9 19:19 /tmp/wicket.log

@jgallagher writes, regarding running wicket as root from within the switch zone:

it could either chown the file itself (if running as root), or not fail on launch if the log file isn't writeable (if not), or both

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the /opt/oxide/wicket/bin/wicket entry point and reproduce launching it as root when /tmp/wicket.log is absent. Inspect how the log file is created and how launch handles an unwritable log; done means the resulting log can be opened by wicket from outside the switch zone, with the chosen behavior for non-writable logs covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.