AppArmor: new keywords, improvements & fixes
ClosedPublic

Authored by nibags on Jan 27 2018, 11:12 AM.

Details

Summary

Update the syntax highlighting of AppArmor, after the release of AppArmor 2.12.0. In summary, in this update new keywords are added and the code is revised and improved.

Changes:

  • Added missing keywords in flags and network and mount rules. Keywords 'read' and 'write' are placed in the 'base_accesses' list.
  • Added keywords for default abstractions & variables, included in the provided AppArmor policy. The purpose of these is to provide autocomplete suggestions when writing Include rules and variables.
  • Fixes: Comments not allowed within rules and in variable assignment lines. The keywords are sensitive. 'Owner' qualifier is not associated with the file rule.
  • General improvements in the highlighting of Include rules, variables, rlimit rules, file permissions and globbing. The code of the profile names, the transition rules and the end of rules context is simplified.

Regards!

Diff Detail

Repository
R216 Syntax Highlighting
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
nibags created this revision.Jan 27 2018, 11:12 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptJan 27 2018, 11:12 AM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
nibags requested review of this revision.Jan 27 2018, 11:12 AM
dhaumann accepted this revision.Jan 28 2018, 11:08 AM
dhaumann added a subscriber: dhaumann.

Looks good and test passes. Just one minor comment that is not really relevant for now - will push in a second.

data/syntax/apparmor.xml
709

Are you looking for \b when using (^|\s) ? Or maybe even for firstNonSpace="true" ?

This revision is now accepted and ready to land.Jan 28 2018, 11:08 AM
This revision was automatically updated to reflect the committed changes.

Thanks!
With (^|\s) I mean that it is not necessarily the first word of a line, rather after a space.