Skip to content

Let FTP read diagnostics logs in the storage root - #29

Open
ducktailgoat wants to merge 1 commit into
OpenCloudGaming:mainfrom
ducktailgoat:fix/storage-log-permissions
Open

ducktailgoat wants to merge 1 commit into
OpenCloudGaming:mainfrom
ducktailgoat:fix/storage-log-permissions

Conversation

@ducktailgoat

Copy link
Copy Markdown

Summary

Homebrew FTP servers cannot read the app's diagnostics: the app creates /download0/opennow as 0700 under its own uid, and ftpsrv (1.16) gets 550 Permission denied on it even while the app is running. Fetching media.log meant copying the whole download0.dat image, which also contains account.bin.

 appStorage::initialize()
-  mkdir /download0/opennow 0700
+  mkdir /download0/opennow 0755
+  fchmod the existing root to 0755 (best effort; a failure never blocks login storage)

Resulting modes on the console:

/download0/opennow/                     drwxr-xr-x   (was drwx------)
  media.log, network.log, ui-perf.log   -rw-r--r--   readable over FTP
  account.bin, session.bin              -rw-------   still private (explicit 0600 + fchmod)
  artwork/                              drwx------   still private

Evidence

  • Before (PS5, app running): LIST /mnt/sandbox/PPSA99082_000/download0/opennow returns 550 Permission denied; RETR of every log fails the same way.

    After (same PS5, first launch of the new build upgrades the existing install): the folder lists, media.log, network.log and live-video.status download, and account.bin / session.bin still return 550 Permission denied.

  • Host test: tests/app_storage_test.cpp asserts mkdir with 0755, fchmod 0755 on the root descriptor, and that initialize() still returns 0 when fchmod fails (EPERM). It failed before the change and passes after it.

Merge Danger

Door: two-way for the code. Installs already upgraded keep their 0755 folder after a revert until something chmods it back.

Blast Radius: console-local file visibility.

Anything that can read the title's download0 (FTP, other homebrew) can now list file names and read diagnostics: logs, live-video.status, video-sps.bin and opt-in capture files. Secrets stay 0600. One pre-existing detail becomes reachable: files created with fopen (live-video.status, capture output) land as 0666 on the console, so they are now writable as well as readable by other local processes.

The storage root /download0/opennow was created 0700 and owned by the
app's uid, so homebrew FTP servers (which lack root override on the
sandbox mount) got 550 on it and could not fetch network.log,
media.log or live-video.status, even while the app was running.

Create the root as 0755 and fchmod existing installs at startup. The
chmod is best effort so a failure cannot block login storage. Account,
settings and session files remain 0600 and the artwork cache remains
0700, so only diagnostics become readable.
@coderabbitai

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 69851c29-6329-40b9-9473-a7854f027120
Commits

Reviewing files that changed from the base of the PR and between b980681 and e1f7432.

Files selected for processing: 2

  • src/app_storage.h
  • tests/app_storage_test.cpp
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant