Skip to content

Fix directory permission flow and filtering#489

Merged
theovilardo merged 2 commits intomasterfrom
codex/fix-critical-bugs-in-allowed-directories
Dec 11, 2025
Merged

Fix directory permission flow and filtering#489
theovilardo merged 2 commits intomasterfrom
codex/fix-critical-bugs-in-allowed-directories

Conversation

@theovilardo
Copy link
Copy Markdown
Owner

Summary

  • gate folder selection in setup until storage permissions are granted
  • normalize allowed directory handling so subdirectories are honored and deselected roots are excluded
  • centralize allowed-directory filtering for songs, albums, and artists

Testing

  • ./gradlew test --console=plain --quiet (terminated early due to time/output constraints)

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +113 to +117
if (!initialSetupDone) return true
if (normalizedAllowed.isEmpty()) return false

val normalizedParent = normalizePath(path)
return normalizedAllowed.any { normalizedParent.startsWith(it) }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Guard allowed-directory checks against prefix collisions

The new isPathAllowed uses a raw startsWith on normalized paths, so any parent path that merely shares a prefix with an allowed folder will be treated as authorized. For example, allowing /storage/emulated/0/Music will also admit songs under /storage/emulated/0/MusicVideos/..., bypassing the user’s selection when initialSetupDone is true. The previous DAO filtering required exact directory matches, so this widens access unexpectedly; consider enforcing path-separator boundaries when comparing directories.

Useful? React with 👍 / 👎.

@theovilardo theovilardo merged commit 08d9a9a into master Dec 11, 2025
@lostf1sh lostf1sh deleted the codex/fix-critical-bugs-in-allowed-directories branch January 16, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant