Commit Graph
28 Commits
Author SHA1 Message Date
topjohnwu 05099cce89 sepolicy: use pure token-based xperm parsing
Update extract_token to only split hyphens when preceding a valid
hex xperm. Revert parse_xperm and parse_xperms to pure token-based
AST parsing without inspecting ID strings.

Assisted-by: Gemini 3.6 Flash
2026-07-31 22:57:41 -07:00
topjohnwu 9d4befe06d sepolicy: add unit tests for statement parsing
Add unit tests covering all PolicyStatement variants, brace set
expansion, xperm ranges/complements, spacing corner cases, and error
cases.

Assisted-by: Gemini 3.6 Flash
2026-07-31 22:57:41 -07:00
topjohnwu 896b78cdd5 sepolicy: parse statements into PolicyStatement enum
Parse tokens into intermediate PolicyStatement enums with meaningful
field names before executing them on SePolicy.

Assisted-by: Gemini 3.6 Flash
2026-07-31 22:57:41 -07:00
Wang Han 14ea5cfb4a Fix sepolicy parsing for hyphenated identifiers 2026-05-05 02:15:16 +08:00
topjohnwu 9ee6a6b3d7 Update to ONDK r29.5 2026-02-06 16:32:25 -08:00
topjohnwu 5bcb55b7fc Format Rust imports with rustfmt 2025-10-19 17:15:30 -07:00
topjohnwu ef4e230258 Use nix for libc functions 2025-09-08 23:59:29 -07:00
topjohnwu 484d53ef7e Update to ONDK r29.2 2025-08-28 16:15:59 -07:00
topjohnwu e91fc75d86 Consolidate for_each implementation into Rust 2025-08-25 01:31:47 -07:00
topjohnwu 37a9724a54 Apply clippy fix 2025-07-02 21:20:14 -07:00
topjohnwu 3327fc668e Remove FsPath and FsPathMnt trait
Directly use Utf8CStr
2025-04-28 17:22:14 -07:00
topjohnwu f3fef7bfe4 Make FsPath a trait 2025-04-22 03:21:00 -07:00
topjohnwu b8f1523fb2 Minor code reorg
[skip ci]
2025-04-08 17:20:22 -07:00
topjohnwu eb54bc1fd7 Cleanup unused code 2025-04-08 02:33:52 -07:00
topjohnwu b7ca73f431 Remove an additional unique_ptr indirection 2025-02-05 14:18:16 +08:00
LoveSy c913f7ec74 Make sepolicy a shared type between rust and cxx 2025-02-04 00:36:11 +08:00
topjohnwu c05e963f37 Address clippy warnings 2025-01-31 02:52:27 +08:00
topjohnwu 7ab98dd5ac Make ioctl not a special token 2025-01-27 03:01:00 +08:00
anonymix007 fc8b3400fc Fix sterm parsing logic for ioctl 2025-01-27 03:01:00 +08:00
LoveSy 9cc50b20d8 Correctly handle comments in sepolicy.rule 2024-07-24 19:02:25 -07:00
LoveSy 652a26d5d9 Fix comment of sepolicy 2024-04-03 21:03:41 -07:00
topjohnwu efa49567fa Fix parsing logic for term and sterm 2024-03-21 18:17:28 -07:00
topjohnwu 0ffc4527a7 Better error reporting 2024-03-21 15:10:34 -07:00
topjohnwu dd9d43be96 Move sepolicy parsing error message into Rust 2024-03-21 14:07:28 -07:00
topjohnwu 6b4baa3bcd Change a little parsing handling 2024-03-21 00:04:09 -07:00
topjohnwu a9ee2d7d18 Fix xperm parsing logic 2024-03-20 23:13:54 -07:00
topjohnwu d654b9cb97 Several code cleanups in sepolicy 2024-03-20 23:09:22 -07:00
LoveSy 4d2921e742 Rewrite sepolicy statement parsing in Rust 2024-03-20 10:12:23 -07:00