Skip to content

refactor(audit): flatpak file perm suffix handling#2096

Open
Commenter25 wants to merge 1 commit intosecureblue:livefrom
Commenter25:supple-suffix-search
Open

refactor(audit): flatpak file perm suffix handling#2096
Commenter25 wants to merge 1 commit intosecureblue:livefrom
Commenter25:supple-suffix-search

Conversation

@Commenter25
Copy link
Copy Markdown
Contributor

@Commenter25 Commenter25 commented Apr 2, 2026

This changes the parse_fs_permission function to have a cleaner check for suffixes. No functionality changes.

For context, this used to be more complex of a PR, but I realized my approach was flawed. But I do feel simplifying the if-else chain away was an improvement, so I've simply stripped it to that aspect.

@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Apr 2, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

Copy link
Copy Markdown
Collaborator

@HastD HastD left a comment

Choose a reason for hiding this comment

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

What's the reason for this change? I don't think the method this PR uses is simpler, and it doesn't provide useful additional info either unless you need to distinguish between "read-write" and "create" permissions.

Comment thread files/system/usr/libexec/secureblue/audit_flatpak/__init__.py Outdated
@Commenter25

This comment was marked as outdated.

Comment thread files/system/usr/libexec/secureblue/audit_flatpak/__init__.py Outdated
HastD
HastD previously approved these changes Apr 3, 2026
@Commenter25 Commenter25 force-pushed the supple-suffix-search branch from ab3bc0c to ad79fe8 Compare April 4, 2026 18:12
@Commenter25 Commenter25 changed the title refactor: suffix handling in audit flatpak refactor(audit): flatpak file perm suffix handling Apr 4, 2026
readonly = perm.endswith(":ro")
[path, _, suffix] = perm.rpartition(":")
if suffix not in FILESYSTEM_SUFFIXES:
path = perm # path actually has :
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What does "path actually has :" mean

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

"the path found in the filesystem permission is a path which actually contains a : character"

if a flatpak was granted access to, iunno, xdg-videos/Garfield: The Movie.mp4, then path would become xdg-videos/Garfield and suffix would become The Movie.mp4, which would be wrong

it is a very rare edge case, but it is technically a permitted character in unix filenames :D

@RoyalOughtness RoyalOughtness requested a review from HastD April 17, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants