Skip to content

Fix sepolicy parsing for hyphenated identifiers#9821

Merged
topjohnwu merged 1 commit into
masterfrom
parse
May 4, 2026
Merged

Fix sepolicy parsing for hyphenated identifiers#9821
topjohnwu merged 1 commit into
masterfrom
parse

Conversation

@aviraxp
Copy link
Copy Markdown
Collaborator

@aviraxp aviraxp commented Apr 22, 2026

This fixes #9819.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a regression in magiskpolicy rule parsing where hyphenated SELinux identifiers (e.g., type names containing -) were incorrectly tokenized, causing syntax errors (linked to issue #9819).

Changes:

  • Stop tokenizing - inside identifiers so hyphenated type/attribute names remain a single identifier token.
  • Extend xperm parsing to accept range syntax encoded as a single identifier token (e.g., 0x1234-0x5678).
  • Refactor xperm hex/range parsing into small helper functions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread native/src/sepolicy/statement.rs Outdated
Comment thread native/src/sepolicy/statement.rs
@topjohnwu topjohnwu merged commit 14ea5cf into master May 4, 2026
55 of 58 checks passed
@topjohnwu topjohnwu deleted the parse branch May 4, 2026 18:15
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.

[Regression] magiskpolicy fails to parse type names containing hyphens ('-') since v27005

3 participants