| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language |
| 3 |
[ |
| 4 |
<!ENTITY varName "[A-Za-z]\w*"> |
| 5 |
<!ENTITY variable "@\{&varName;\}"> |
| 6 |
<!ENTITY exec "[pPcC]?[iuU]?x"> |
| 7 |
<!ENTITY globbChars "*?"> |
| 8 |
<!-- Characters not allowed in a path --> |
| 9 |
<!ENTITY noPathChar "\s\)""> |
| 10 |
<!ENTITY noPathCharWithoutSpace ")""> |
| 11 |
<!ENTITY endPath ",(?:[\s"]|$)"> |
| 12 |
<!ENTITY url "\bhttps?://[^\s<>"'`]*[^\s<>"'`\}\)\]\.,;\|]"> |
| 13 |
<!-- Email (Source: http://emailregex.com) --> |
| 14 |
<!ENTITY email "(?:(?:[^<>\(\)\[\]\\\.,;:\s@"]+(?:\.[^<>\(\)\[\]\\\.,;:\s@"]+)*)|(?:"[^"]+"))@(?:(?:\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}])|(?:(?:[a-zA-Z\-\d]+\.)+[a-zA-Z]{2,}))\b"> |
| 15 |
|
| 16 |
<!ENTITY _perm_correction_in_p "p[iUu]?x(?:[rwakml]|p[iUu]?x)*[PcC]?[iUu]?"> |
| 17 |
<!ENTITY _perm_correction_in_P "P[iUu]?x(?:[rwakml]|P[iUu]?x)*[pcC]?[iUu]?"> |
| 18 |
<!ENTITY _perm_correction_in_c "c[iUu]?x(?:[rwakml]|c[iUu]?x)*[PpC]?[iUu]?"> |
| 19 |
<!ENTITY _perm_correction_in_C "C[iUu]?x(?:[rwakml]|C[iUu]?x)*[Ppc]?[iUu]?"> |
| 20 |
<!ENTITY _perm_correction_in_i "[PpCc]?ix(?:[rwakml]|[PpCc]?ix)*[PpCc]?[Uu]?"> |
| 21 |
<!ENTITY _perm_correction_in_u "[PpCc]?ux(?:[rwakml]|[PpCc]?ux)*[PpCc]?[iU]?"> |
| 22 |
<!ENTITY _perm_correction_in_U "[PpCc]?Ux(?:[rwakml]|[PpCc]?Ux)*[PpCc]?[iu]?"> |
| 23 |
<!ENTITY _perm_correction_in_x1 "[iuU]?x(?:[rwakml]|[iuU]?x)*[PpCc][iuU]?"> <!-- x, ix, ux or Ux followed by P, p, C or c --> |
| 24 |
<!ENTITY _perm_correction_in_x2 "x[rwakmlx]*[iuU]"> <!-- x followed by ix, ux or Ux --> |
| 25 |
<!ENTITY perm_correction_in "(?:^|\s)[rwakml]*(?:&_perm_correction_in_p;|&_perm_correction_in_P;|&_perm_correction_in_c;|&_perm_correction_in_C;|&_perm_correction_in_i;|&_perm_correction_in_u;|&_perm_correction_in_U;|&_perm_correction_in_x1;|&_perm_correction_in_x2;)x(?:[rwakml]|&exec;)*(?:[\s,]|$)"> <!-- x followed by ix, ux or Ux --> |
| 26 |
|
| 27 |
<!ENTITY _path "(?:[^\s/\[\\]|//|\\.|\[(?:[^\s\]\\]|\\.)*\])*"> |
| 28 |
<!ENTITY _path_quoted ""(?:[^/"\[\\]|//|\\.|\[(?:[^"\]\\]|\\.)*\])*"> |
| 29 |
<!ENTITY path "(?:&_path;|&_path_quoted;)/(?:$|[^/])"> |
| 30 |
]> |
| 31 |
|
| 32 |
<!-- |
| 33 |
AppArmor Profiles Syntax Highlighting Definition |
| 34 |
=========================================================================== |
| 35 |
|
| 36 |
This file is part of the KDE's KSyntaxHighlighting framework. |
| 37 |
|
| 38 |
SPDX-FileCopyrightText: 2017-2020 Nibaldo González S. <[email protected]> |
| 39 |
|
| 40 |
SPDX-License-Identifier: MIT |
| 41 |
|
| 42 |
=========================================================================== |
| 43 |
|
| 44 |
Last update: |
| 45 |
Syntax highlighting based on AppArmor 3.0.0 |
| 46 |
For more details about the syntax of AppArmor profiles, visit: |
| 47 |
https://gitlab.com/apparmor/apparmor/wikis/Documentation |
| 48 |
https://manpages.ubuntu.com/manpages/focal/en/man5/apparmor.d.5.html |
| 49 |
|
| 50 |
Change log: |
| 51 |
* Version 12 [02-Oct-2020]: (AppArmor 3.0) Add ABI rules and new profile flags. |
| 52 |
* Version 11 [30-Sep-2020]: Update itemData's and rule_mount_fstypes list. |
| 53 |
* Version 10 [25-Oct-2019]: Use non-capturing groups in RegExpr. |
| 54 |
* Version 9 [20-Jun-2019]: (AppArmor 2.13.3): |
| 55 |
- Add new network domain keywords. |
| 56 |
- Fixes: drop unsupported 'to' operator for link rules and only highlight the 'in' |
| 57 |
operator in mount rules. Only highlight valid numbers in rlimit rules. |
| 58 |
* Version 8 [02-Apr-2019]: (AppArmor 2.13.2) |
| 59 |
- Do not highlight variable assignments and alias rules within profiles. |
| 60 |
- Add keywords of "tunables/share" variables. |
| 61 |
- Change style of "Other Option" attribute and remove one indentation. |
| 62 |
* Version 7 [15-Sep-2018]: |
| 63 |
- Update itemData's style for the new Solarized color schemes. |
| 64 |
- Fixes in "_end_rule_irnc". |
| 65 |
* Version 6 [24-Jul-2018, by Nibaldo G.]: (AppArmor 2.13.0) |
| 66 |
- Fixes for Include rules, add 'if exists'. Fix escapes & globbing in text quoted. |
| 67 |
- Improvements in paths that start with variables, hats, comments and variable |
| 68 |
assignments and others. Add some abstractions & filesystems. |
| 69 |
* Version 4 [25-Jan-2018, by Nibaldo G.]: (AppArmor 2.12.0) |
| 70 |
- New keywords: network and mount rules, default abstractions, variables and others. |
| 71 |
- Multiple improvements and fixes. |
| 72 |
- Do not allow comments within rules and in variable assignment lines. |
| 73 |
* Version 3 [24-Sep-2017, by Nibaldo G.]: |
| 74 |
- Fix incorrect highlighting of the DBus rule 'name' keyword. |
| 75 |
* Version 2 [29-Aug-2017, by Nibaldo G.]: |
| 76 |
- Improvements and bug fixes. |
| 77 |
- Each rule has its own context. |
| 78 |
- The profile name is highlighted in the profile header and profile transition rules. |
| 79 |
* Version 1 [22-Feb-2017, by Nibaldo González]: |
| 80 |
- Initial version. Support for profile syntax of Apparmor 2.11. |
| 81 |
--> |
| 82 |
|
| 83 |
<language name="AppArmor Security Profile" |
| 84 |
version="16" |
| 85 |
kateversion="5.0" |
| 86 |
section="Markup" |
| 87 |
extensions="usr.bin.*;usr.sbin.*;bin.*;sbin.*;usr.lib.*;usr.lib64.*;usr.lib32.*;usr.libx32.*;usr.libexec.*;usr.local.bin.*;usr.local.sbin.*;usr.local.lib*;opt.*;etc.cron.*;snap.*;snap-update-ns.*;snap-confine.*" |
| 88 |
priority="0" |
| 89 |
mimetype="" |
| 90 |
author="Nibaldo González ([email protected])" |
| 91 |
license="MIT"> |
| 92 |
|
| 93 |
<highlighting> |
| 94 |
|
| 95 |
<!-- Profile Header --> |
| 96 |
<list name="profile_head"> |
| 97 |
<item>profile</item> |
| 98 |
<item>hat</item> |
| 99 |
</list> |
| 100 |
<list name="profile_options"> |
| 101 |
<item>flags</item> |
| 102 |
<item>xattrs</item> |
| 103 |
</list> |
| 104 |
<list name="profile_flags"> |
| 105 |
<item>audit</item> |
| 106 |
<item>complain</item> |
| 107 |
<item>enforce</item> |
| 108 |
<item>kill</item> |
| 109 |
<item>unconfined</item> |
| 110 |
<item>mediate_deleted</item> |
| 111 |
<item>attach_disconnected</item> |
| 112 |
<item>chroot_relative</item> |
| 113 |
<!-- Others --> |
| 114 |
<item>chroot_attach</item> |
| 115 |
<item>chroot_no_attach</item> |
| 116 |
<item>delegate_deleted</item> |
| 117 |
<item>no_attach_disconnected</item> |
| 118 |
<item>namespace_relative</item> |
| 119 |
</list> |
| 120 |
|
| 121 |
<!-- Rule Qualifiers --> |
| 122 |
<list name="rule_access_qualifiers"> |
| 123 |
<item>allow</item> |
| 124 |
<item>deny</item> |
| 125 |
</list> |
| 126 |
<list name="file_rule_qualifiers"> |
| 127 |
<item>owner</item> |
| 128 |
<item>other</item> |
| 129 |
</list> |
| 130 |
<list name="rule_qualifiers"> |
| 131 |
<item>audit</item> |
| 132 |
<!-- noaudit/quiet, defined, not --> |
| 133 |
</list> |
| 134 |
<!-- Conditional: if, else --> |
| 135 |
|
| 136 |
<!-- Capabilities, Capability Rule. |
| 137 |
Lowercase capability name without 'CAP_' prefix. |
| 138 |
http://man7.org/linux/man-pages/man7/capabilities.7.html --> |
| 139 |
<list name="rule_capability"> |
| 140 |
<item>audit_control</item> |
| 141 |
<item>audit_read</item> |
| 142 |
<item>audit_write</item> |
| 143 |
<item>block_suspend</item> |
| 144 |
<item>chown</item> |
| 145 |
<item>dac_override</item> |
| 146 |
<item>dac_read_search</item> |
| 147 |
<item>fowner</item> |
| 148 |
<item>fsetid</item> |
| 149 |
<item>ipc_lock</item> |
| 150 |
<item>ipc_owner</item> |
| 151 |
<item>kill</item> |
| 152 |
<item>lease</item> |
| 153 |
<item>linux_immutable</item> |
| 154 |
<item>mac_admin</item> |
| 155 |
<item>mac_override</item> |
| 156 |
<item>mknod</item> |
| 157 |
<item>net_admin</item> |
| 158 |
<item>net_bind_service</item> |
| 159 |
<item>net_broadcast</item> |
| 160 |
<item>net_raw</item> |
| 161 |
<item>setgid</item> |
| 162 |
<item>setfcap</item> |
| 163 |
<item>setpcap</item> |
| 164 |
<item>setuid</item> |
| 165 |
<item>sys_admin</item> |
| 166 |
<item>sys_boot</item> |
| 167 |
<item>sys_chroot</item> |
| 168 |
<item>sys_module</item> |
| 169 |
<item>sys_nice</item> |
| 170 |
<item>sys_pacct</item> |
| 171 |
<item>sys_ptrace</item> |
| 172 |
<item>sys_rawio</item> |
| 173 |
<item>sys_resource</item> |
| 174 |
<item>sys_time</item> |
| 175 |
<item>sys_tty_config</item> |
| 176 |
<item>syslog</item> |
| 177 |
<item>wake_alarm</item> |
| 178 |
</list> |
| 179 |
|
| 180 |
<!-- Network Rule --> |
| 181 |
<list name="rule_network"> |
| 182 |
<!-- Domain. |
| 183 |
Also: unix --> |
| 184 |
<item>inet</item> |
| 185 |
<item>ax25</item> |
| 186 |
<item>ipx</item> |
| 187 |
<item>appletalk</item> |
| 188 |
<item>netrom</item> |
| 189 |
<item>bridge</item> |
| 190 |
<item>atmpvc</item> |
| 191 |
<item>x25</item> |
| 192 |
<item>inet6</item> |
| 193 |
<item>rose</item> |
| 194 |
<item>netbeui</item> |
| 195 |
<item>security</item> |
| 196 |
<item>key</item> |
| 197 |
<item>packet</item> |
| 198 |
<item>ash</item> |
| 199 |
<item>econet</item> |
| 200 |
<item>atmsvc</item> |
| 201 |
<item>sna</item> |
| 202 |
<item>irda</item> |
| 203 |
<item>pppox</item> |
| 204 |
<item>wanpipe</item> |
| 205 |
<item>bluetooth</item> |
| 206 |
<item>netlink</item> |
| 207 |
<item>rds</item> |
| 208 |
<item>llc</item> |
| 209 |
<item>can</item> |
| 210 |
<item>tipc</item> |
| 211 |
<item>iucv</item> |
| 212 |
<item>rxrpc</item> |
| 213 |
<item>isdn</item> |
| 214 |
<item>phonet</item> |
| 215 |
<item>ieee802154</item> |
| 216 |
<item>caif</item> |
| 217 |
<item>alg</item> |
| 218 |
<item>nfc</item> |
| 219 |
<item>vsock</item> |
| 220 |
<item>mpls</item> |
| 221 |
<item>ib</item> |
| 222 |
<item>kcm</item> |
| 223 |
<item>smc</item> |
| 224 |
<item>qipcrtr</item> |
| 225 |
<item>xdp</item> |
| 226 |
|
| 227 |
<!-- Type. |
| 228 |
Also: packet --> |
| 229 |
<item>stream</item> |
| 230 |
<item>dgram</item> |
| 231 |
<item>seqpacket</item> |
| 232 |
<item>rdm</item> |
| 233 |
<item>raw</item> |
| 234 |
|
| 235 |
<!-- Protocol --> |
| 236 |
<item>tcp</item> |
| 237 |
<item>udp</item> |
| 238 |
<item>icmp</item> |
| 239 |
</list> |
| 240 |
<list name="rule_network_unix"> |
| 241 |
<!-- NOTE: This keyword is placed in a separate list, |
| 242 |
to avoid conflicts with the 'unix' rule name. --> |
| 243 |
<item>unix</item> |
| 244 |
</list> |
| 245 |
|
| 246 |
<!-- Mount Rule --> |
| 247 |
<list name="rule_mount_options"> |
| 248 |
<item>fstype</item> |
| 249 |
<item>vfstype</item> |
| 250 |
<item>options</item> |
| 251 |
<item>option</item> |
| 252 |
</list> |
| 253 |
<list name="rule_mount_flags"> |
| 254 |
<item>r</item> |
| 255 |
<item>w</item> |
| 256 |
<item>rw</item> |
| 257 |
<item>ro</item> |
| 258 |
<item>read-only</item> |
| 259 |
<item>suid</item> |
| 260 |
<item>nosuid</item> |
| 261 |
<item>dev</item> |
| 262 |
<item>nodev</item> |
| 263 |
<item>exec</item> |
| 264 |
<item>noexec</item> |
| 265 |
<item>sync</item> |
| 266 |
<item>async</item> |
| 267 |
<item>remount</item> |
| 268 |
<item>mand</item> |
| 269 |
<item>nomand</item> |
| 270 |
<item>dirsync</item> |
| 271 |
<item>atime</item> |
| 272 |
<item>noatime</item> |
| 273 |
<item>diratime</item> |
| 274 |
<item>nodiratime</item> |
| 275 |
<item>bind</item> |
| 276 |
<item>B</item> |
| 277 |
<item>move</item> |
| 278 |
<item>M</item> |
| 279 |
<item>rbind</item> |
| 280 |
<item>R</item> |
| 281 |
<item>verbose</item> |
| 282 |
<item>silent</item> |
| 283 |
<item>loud</item> |
| 284 |
<item>acl</item> |
| 285 |
<item>noacl</item> |
| 286 |
<item>unbindable</item> |
| 287 |
<item>make-unbindable</item> |
| 288 |
<item>runbindable</item> |
| 289 |
<item>make-runbindable</item> |
| 290 |
<item>private</item> |
| 291 |
<item>make-private</item> |
| 292 |
<item>rprivate</item> |
| 293 |
<item>make-rprivate</item> |
| 294 |
<item>slave</item> |
| 295 |
<item>make-slave</item> |
| 296 |
<item>rslave</item> |
| 297 |
<item>make-rslave</item> |
| 298 |
<item>shared</item> |
| 299 |
<item>make-shared</item> |
| 300 |
<item>rshared</item> |
| 301 |
<item>make-rshared</item> |
| 302 |
<item>relatime</item> |
| 303 |
<item>norelatime</item> |
| 304 |
<item>iversion</item> |
| 305 |
<item>noiversion</item> |
| 306 |
<item>strictatime</item> |
| 307 |
<item>user</item> |
| 308 |
<item>nouser</item> |
| 309 |
</list> |
| 310 |
<list name="rule_mount_fstypes"> |
| 311 |
<!-- Stackable FS --> |
| 312 |
<item>ecryptfs</item> |
| 313 |
<item>cryfs</item> |
| 314 |
<item>encfs</item> |
| 315 |
<item>overlayfs</item> |
| 316 |
<item>unionfs</item> |
| 317 |
<!-- Specialpurpose FS --> |
| 318 |
<item>devtmpfs</item> |
| 319 |
<item>ramfs</item> |
| 320 |
<item>tmpfs</item> |
| 321 |
<!-- Block-based, Network & Pseudo FS --> |
| 322 |
<item>adfs</item> |
| 323 |
<item>affs</item> |
| 324 |
<item>afs</item> |
| 325 |
<item>apfs</item> |
| 326 |
<item>apparmorfs</item> |
| 327 |
<item>autofs</item> |
| 328 |
<item>bdev</item> |
| 329 |
<item>bfs</item> |
| 330 |
<item>bpf</item> |
| 331 |
<item>btrfs</item> |
| 332 |
<item>cachefs</item> |
| 333 |
<item>ceph</item> |
| 334 |
<item>cgroup2</item> |
| 335 |
<item>cgroup</item> |
| 336 |
<item>cifs</item> |
| 337 |
<item>coda</item> |
| 338 |
<item>coherent</item> |
| 339 |
<item>configfs</item> |
| 340 |
<item>cpuset</item> |
| 341 |
<item>cramfs</item> |
| 342 |
<item>debugfs</item> |
| 343 |
<item>devfs</item> |
| 344 |
<item>devpts</item> |
| 345 |
<item>efs</item> |
| 346 |
<item>exfat</item> |
| 347 |
<item>ext2</item> |
| 348 |
<item>ext3</item> |
| 349 |
<item>ext4</item> |
| 350 |
<item>f2fs</item> |
| 351 |
<item>fatx</item> |
| 352 |
<item>functionfs</item> |
| 353 |
<item>fuse</item> |
| 354 |
<item>fuseblk</item> |
| 355 |
<item>fusectl</item> |
| 356 |
<item>futexfs</item> |
| 357 |
<item>gfs</item> |
| 358 |
<item>hfs</item> |
| 359 |
<item>hfsplus</item> |
| 360 |
<item>hpfs</item> |
| 361 |
<item>hugetlbfs</item> |
| 362 |
<item>ifs</item> |
| 363 |
<item>inotifyfs</item> |
| 364 |
<item>iso9660</item> |
| 365 |
<item>jffs2</item> |
| 366 |
<item>jffs</item> |
| 367 |
<item>jfs</item> |
| 368 |
<item>kernfs</item> |
| 369 |
<item>labeledfs</item> |
| 370 |
<item>lvm2</item> |
| 371 |
<item>minix</item> |
| 372 |
<item>mqueue</item> |
| 373 |
<item>msdos</item> |
| 374 |
<item>ncpfs</item> |
| 375 |
<item>nfs4</item> |
| 376 |
<item>nfs</item> |
| 377 |
<item>nilfs2</item> |
| 378 |
<item>nilfs</item> |
| 379 |
<item>ntfs-3g</item> |
| 380 |
<item>ntfs</item> |
| 381 |
<item>ocfs</item> |
| 382 |
<item>oemfs</item> |
| 383 |
<item>pipefs</item> |
| 384 |
<item>proc</item> |
| 385 |
<item>procfs</item> |
| 386 |
<item>pstore</item> |
| 387 |
<item>pstorefs</item> |
| 388 |
<item>qnx4</item> |
| 389 |
<item>qnx6</item> |
| 390 |
<item>reiser4</item> |
| 391 |
<item>reiserfs</item> |
| 392 |
<item>romfs</item> |
| 393 |
<item>rootfs</item> |
| 394 |
<item>sdcardfs</item> |
| 395 |
<item>securityfs</item> |
| 396 |
<item>selinuxfs</item> |
| 397 |
<item>shm</item> |
| 398 |
<item>smbfs</item> |
| 399 |
<item>sockfs</item> |
| 400 |
<item>specfs</item> |
| 401 |
<item>squashfs</item> |
| 402 |
<item>swap</item> |
| 403 |
<item>swapfs</item> |
| 404 |
<item>sysfs</item> |
| 405 |
<item>sysv</item> |
| 406 |
<item>tracefs</item> |
| 407 |
<item>ubifs</item> |
| 408 |
<item>udf</item> |
| 409 |
<item>ufs</item> |
| 410 |
<item>umsdos</item> |
| 411 |
<item>urefs</item> |
| 412 |
<item>usbfs</item> |
| 413 |
<item>vfat</item> |
| 414 |
<item>xenix</item> |
| 415 |
<item>xfs</item> |
| 416 |
<item>yaffs2</item> |
| 417 |
<item>yaffs</item> |
| 418 |
<item>zfs</item> |
| 419 |
<!-- Not included: ext, usbdevfs, xiafs --> |
| 420 |
</list> |
| 421 |
|
| 422 |
<!-- Pivot Root Rule --> |
| 423 |
<list name="rule_pivotroot_options"> |
| 424 |
<item>oldroot</item> |
| 425 |
</list> |
| 426 |
|
| 427 |
<!-- Ptrace Rule --> |
| 428 |
<list name="rule_ptrace_options"> |
| 429 |
<item>peer</item> |
| 430 |
</list> |
| 431 |
<list name="rule_ptrace_access"> |
| 432 |
<!-- Also: r, w, rw, read --> |
| 433 |
<item>readby</item> |
| 434 |
<item>trace</item> |
| 435 |
<item>tracedby</item> |
| 436 |
</list> |
| 437 |
|
| 438 |
<!-- Signal Rule --> |
| 439 |
<list name="rule_signal_options"> |
| 440 |
<item>set</item> |
| 441 |
<item>peer</item> |
| 442 |
</list> |
| 443 |
<list name="rule_signal"> |
| 444 |
<!-- Also: rtmin+0 ... rtmin+32 --> |
| 445 |
<item>bus</item> |
| 446 |
<item>hup</item> |
| 447 |
<item>int</item> |
| 448 |
<item>quit</item> |
| 449 |
<item>ill</item> |
| 450 |
<item>trap</item> |
| 451 |
<item>abrt</item> |
| 452 |
<item>fpe</item> |
| 453 |
<item>kill</item> |
| 454 |
<item>usr1</item> |
| 455 |
<item>segv</item> |
| 456 |
<item>usr2</item> |
| 457 |
<item>pipe</item> |
| 458 |
<item>alrm</item> |
| 459 |
<item>term</item> |
| 460 |
<item>stkflt</item> |
| 461 |
<item>chld</item> |
| 462 |
<item>cont</item> |
| 463 |
<item>stop</item> |
| 464 |
<item>stp</item> |
| 465 |
<item>ttin</item> |
| 466 |
<item>ttou</item> |
| 467 |
<item>urg</item> |
| 468 |
<item>xcpu</item> |
| 469 |
<item>xfsz</item> |
| 470 |
<item>vtalrm</item> |
| 471 |
<item>prof</item> |
| 472 |
<item>winch</item> |
| 473 |
<item>io</item> |
| 474 |
<item>pwr</item> |
| 475 |
<item>sys</item> |
| 476 |
<item>emt</item> |
| 477 |
<item>exists</item> |
| 478 |
</list> |
| 479 |
<list name="rule_signal_access"> |
| 480 |
<!-- Also: r, w, rw, read, write --> |
| 481 |
<item>send</item> |
| 482 |
<item>receive</item> |
| 483 |
</list> |
| 484 |
|
| 485 |
<!-- DBus Rule --> |
| 486 |
<list name="rule_dbus_options"> |
| 487 |
<item>peer</item> |
| 488 |
<item>bus</item> |
| 489 |
<item>path</item> |
| 490 |
<item>interface</item> |
| 491 |
<item>member</item> |
| 492 |
<item>name</item> |
| 493 |
</list> |
| 494 |
<list name="rule_dbus_peer"> |
| 495 |
<item>name</item> |
| 496 |
<item>label</item> |
| 497 |
</list> |
| 498 |
<list name="rule_dbus_access"> |
| 499 |
<!-- Also: r, w, rw, read, write --> |
| 500 |
<item>send</item> |
| 501 |
<item>receive</item> |
| 502 |
<item>bind</item> |
| 503 |
<item>eavesdrop</item> |
| 504 |
</list> |
| 505 |
<list name="rule_dbus_bus"> |
| 506 |
<item>system</item> |
| 507 |
<item>session</item> |
| 508 |
</list> |
| 509 |
|
| 510 |
<!-- Unix Rule --> |
| 511 |
<list name="rule_unix_options"> |
| 512 |
<item>peer</item> |
| 513 |
<item>set</item> |
| 514 |
<item>label</item> |
| 515 |
<item>type</item> |
| 516 |
<item>protocol</item> |
| 517 |
<item>addr</item> |
| 518 |
<item>attr</item> |
| 519 |
<item>opt</item> |
| 520 |
</list> |
| 521 |
<list name="rule_unix_access"> |
| 522 |
<!-- Also: r, w, rw, read, write --> |
| 523 |
<item>send</item> |
| 524 |
<item>receive</item> |
| 525 |
<item>bind</item> |
| 526 |
<item>create</item> |
| 527 |
<item>listen</item> |
| 528 |
<item>accept</item> |
| 529 |
<item>connect</item> |
| 530 |
<item>shutdown</item> |
| 531 |
<item>getattr</item> |
| 532 |
<item>setattr</item> |
| 533 |
<item>getopt</item> |
| 534 |
<item>setopt</item> |
| 535 |
</list> |
| 536 |
|
| 537 |
<!-- Rlimit Rule --> |
| 538 |
<list name="rule_rlimit"> |
| 539 |
<item>cpu</item> |
| 540 |
<item>fsize</item> |
| 541 |
<item>data</item> |
| 542 |
<item>stack</item> |
| 543 |
<item>core</item> |
| 544 |
<item>rss</item> |
| 545 |
<item>nofile</item> |
| 546 |
<item>ofile</item> |
| 547 |
<item>as</item> |
| 548 |
<item>nproc</item> |
| 549 |
<item>memlock</item> |
| 550 |
<item>locks</item> |
| 551 |
<item>sigpending</item> |
| 552 |
<item>msgqueue</item> |
| 553 |
<item>nice</item> |
| 554 |
<item>rtprio</item> |
| 555 |
<item>rttime</item> |
| 556 |
</list> |
| 557 |
|
| 558 |
<!-- Link Rule --> |
| 559 |
<list name="rule_link"> |
| 560 |
<item>subset</item> |
| 561 |
</list> |
| 562 |
|
| 563 |
<!-- Change Profile Rule --> |
| 564 |
<list name="rule_changeprofile"> |
| 565 |
<item>safe</item> |
| 566 |
<item>unsafe</item> |
| 567 |
</list> |
| 568 |
|
| 569 |
<!-- Include Rule --> |
| 570 |
<list name="rule_include"> |
| 571 |
<item>if</item> |
| 572 |
<item>exists</item> |
| 573 |
</list> |
| 574 |
|
| 575 |
<!-- Permissions --> |
| 576 |
<list name="base_accesses"> |
| 577 |
<item>rw</item> |
| 578 |
<item>r</item> |
| 579 |
<item>w</item> |
| 580 |
<item>read</item> |
| 581 |
<item>write</item> |
| 582 |
</list> |
| 583 |
|
| 584 |
<!-- Abstractions and variables defined in the provided AppArmor policy. |
| 585 |
NOTE: The following keywords are not used for highlighting. The purpose of these |
| 586 |
is to provide autocomplete suggestions when writing Include rules and variables. --> |
| 587 |
<list name="default_variables"> |
| 588 |
<item>profile_name</item> <!-- Special variable --> |
| 589 |
|
| 590 |
<item>HOME</item> |
| 591 |
<item>HOMEDIRS</item> |
| 592 |
<item>multiarch</item> |
| 593 |
<item>pid</item> |
| 594 |
<item>pids</item> |
| 595 |
<item>PROC</item> |
| 596 |
<item>securityfs</item> |
| 597 |
<item>apparmorfs</item> |
| 598 |
<item>sys</item> |
| 599 |
<item>tid</item> |
| 600 |
<item>XDG_DESKTOP_DIR</item> |
| 601 |
<item>XDG_DOWNLOAD_DIR</item> |
| 602 |
<item>XDG_TEMPLATES_DIR</item> |
| 603 |
<item>XDG_PUBLICSHARE_DIR</item> |
| 604 |
<item>XDG_DOCUMENTS_DIR</item> |
| 605 |
<item>XDG_MUSIC_DIR</item> |
| 606 |
<item>XDG_PICTURES_DIR</item> |
| 607 |
<item>XDG_VIDEOS_DIR</item> |
| 608 |
<item>flatpak_exports_root</item> |
| 609 |
<item>system_share_dirs</item> |
| 610 |
<item>user_share_dirs</item> |
| 611 |
</list> |
| 612 |
<list name="default_abstractions"> |
| 613 |
<item>abstractions/</item> |
| 614 |
<item>apache2-common</item> |
| 615 |
<item>aspell</item> |
| 616 |
<item>audio</item> |
| 617 |
<item>authentication</item> |
| 618 |
<item>base</item> |
| 619 |
<item>bash</item> |
| 620 |
<item>consoles</item> |
| 621 |
<item>cups-client</item> |
| 622 |
<item>dbus</item> |
| 623 |
<item>dbus-accessibility</item> |
| 624 |
<item>dbus-accessibility-strict</item> |
| 625 |
<item>dbus-session</item> |
| 626 |
<item>dbus-session-strict</item> |
| 627 |
<item>dbus-strict</item> |
| 628 |
<item>dconf</item> |
| 629 |
<item>dovecot-common</item> |
| 630 |
<item>dri-common</item> |
| 631 |
<item>dri-enumerate</item> |
| 632 |
<item>enchant</item> |
| 633 |
<item>fcitx</item> |
| 634 |
<item>fcitx-strict</item> |
| 635 |
<item>fonts</item> |
| 636 |
<item>freedesktop.org</item> |
| 637 |
<item>gnome</item> |
| 638 |
<item>gnupg</item> |
| 639 |
<item>ibus</item> |
| 640 |
<item>kde-icon-cache-write</item> |
| 641 |
<item>kde-globals-write</item> |
| 642 |
<item>kde-language-write</item> |
| 643 |
<item>kde</item> |
| 644 |
<item>kerberosclient</item> |
| 645 |
<item>launchpad-integration</item> |
| 646 |
<item>ldapclient</item> |
| 647 |
<item>libpam-systemd</item> |
| 648 |
<item>likewise</item> |
| 649 |
<item>mdns</item> |
| 650 |
<item>mesa</item> |
| 651 |
<item>mir</item> |
| 652 |
<item>mozc</item> |
| 653 |
<item>mysql</item> |
| 654 |
<item>nameservice</item> |
| 655 |
<item>nis</item> |
| 656 |
<item>nvidia</item> |
| 657 |
<item>opencl</item> |
| 658 |
<item>opencl-common</item> |
| 659 |
<item>opencl-intel</item> |
| 660 |
<item>opencl-mesa</item> |
| 661 |
<item>opencl-nvidia</item> |
| 662 |
<item>opencl-pocl</item> |
| 663 |
<item>openssl</item> |
| 664 |
<item>orbit2</item> |
| 665 |
<item>p11-kit</item> |
| 666 |
<item>perl</item> |
| 667 |
<item>php</item> |
| 668 |
<item>php5</item> |
| 669 |
<item>postfix-common</item> |
| 670 |
<item>private-files</item> |
| 671 |
<item>private-files-strict</item> |
| 672 |
<item>python</item> |
| 673 |
<item>qt5-compose-cache-write</item> |
| 674 |
<item>qt5-settings-write</item> |
| 675 |
<item>qt5</item> |
| 676 |
<item>recent-documents-write</item> |
| 677 |
<item>ruby</item> |
| 678 |
<item>samba</item> |
| 679 |
<item>smbpass</item> |
| 680 |
<item>ssl_certs</item> |
| 681 |
<item>ssl_keys</item> |
| 682 |
<item>svn-repositories</item> |
| 683 |
<item>ubuntu-bittorrent-clients</item> |
| 684 |
<item>ubuntu-browsers</item> |
| 685 |
<item>ubuntu-console-browsers</item> |
| 686 |
<item>ubuntu-console-email</item> |
| 687 |
<item>ubuntu-email</item> |
| 688 |
<item>ubuntu-feed-readers</item> |
| 689 |
<item>ubuntu-gnome-terminal</item> |
| 690 |
<item>ubuntu-helpers</item> |
| 691 |
<item>ubuntu-konsole</item> |
| 692 |
<item>ubuntu-media-players</item> |
| 693 |
<item>ubuntu-unity7-base</item> |
| 694 |
<item>ubuntu-unity7-launcher</item> |
| 695 |
<item>ubuntu-unity7-messaging</item> |
| 696 |
<item>ubuntu-xterm</item> |
| 697 |
<item>user-download</item> |
| 698 |
<item>user-mail</item> |
| 699 |
<item>user-manpages</item> |
| 700 |
<item>user-tmp</item> |
| 701 |
<item>user-write</item> |
| 702 |
<item>video</item> |
| 703 |
<item>vulkan</item> |
| 704 |
<item>wayland</item> |
| 705 |
<item>web-data</item> |
| 706 |
<item>winbind</item> |
| 707 |
<item>wutmp</item> |
| 708 |
<item>X</item> |
| 709 |
<item>xad</item> |
| 710 |
<item>xdg-desktop</item> |
| 711 |
|
| 712 |
<item>ubuntu-browsers.d/</item> |
| 713 |
<item>java</item> |
| 714 |
<item>mailto</item> |
| 715 |
<item>multimedia</item> |
| 716 |
<item>plugins-common</item> |
| 717 |
<item>productivity</item> |
| 718 |
<item>text-editors</item> |
| 719 |
<item>ubuntu-integration</item> |
| 720 |
<item>ubuntu-integration-xul</item> |
| 721 |
<item>user-files</item> |
| 722 |
|
| 723 |
<item>apparmor_api/</item> |
| 724 |
<item>change_profile</item> |
| 725 |
<item>examine</item> |
| 726 |
<item>find_mountpoint</item> |
| 727 |
<item>introspect</item> |
| 728 |
<item>is_enabled</item> |
| 729 |
|
| 730 |
<item>tunables/</item> |
| 731 |
<item>alias</item> |
| 732 |
<item>apparmorfs</item> |
| 733 |
<item>dovecot</item> |
| 734 |
<item>global</item> |
| 735 |
<item>home</item> |
| 736 |
<item>kernelvars</item> |
| 737 |
<item>multiarch</item> |
| 738 |
<item>ntpd</item> |
| 739 |
<item>proc</item> |
| 740 |
<item>securityfs</item> |
| 741 |
<item>sys</item> |
| 742 |
<item>xdg-user-dirs</item> |
| 743 |
<item>home.d/</item> |
| 744 |
<item>multiarch.d/</item> |
| 745 |
<item>xdg-user-dirs.d/</item> |
| 746 |
<item>site.local</item> |
| 747 |
|
| 748 |
<item>local/</item> |
| 749 |
</list> |
| 750 |
|
| 751 |
<list name="boolean"> |
| 752 |
<item>true</item> |
| 753 |
<item>false</item> |
| 754 |
</list> |
| 755 |
<list name="other_words"> |
| 756 |
<item>unspec</item> |
| 757 |
<item>none</item> |
| 758 |
<item>unconfined</item> |
| 759 |
</list> |
| 760 |
|
| 761 |
<!-- Rule Names. |
| 762 |
NOTE: |
| 763 |
- Each rule name is a keyword in separate lists, since each |
| 764 |
has a different context and for a correct delimitation of the words. |
| 765 |
- The content of a rule is found in the contexts "_default_rule" |
| 766 |
and "_default_rule_with_comments". |
| 767 |
- When adding a new rule, add it also in "_end_rule_irnc"! --> |
| 768 |
<list name="rule_name_mount"> |
| 769 |
<item>mount</item> |
| 770 |
<item>remount</item> |
| 771 |
<item>umount</item> |
| 772 |
</list> |
| 773 |
<list name="rule_name_abi"><item>abi</item></list> |
| 774 |
<list name="rule_name_alias"><item>alias</item></list> |
| 775 |
<list name="rule_name_file"><item>file</item></list> |
| 776 |
<list name="rule_name_capability"><item>capability</item></list> |
| 777 |
<list name="rule_name_network"><item>network</item></list> |
| 778 |
<list name="rule_name_pivotroot"><item>pivot_root</item></list> |
| 779 |
<list name="rule_name_ptrace"><item>ptrace</item></list> |
| 780 |
<list name="rule_name_signal"><item>signal</item></list> |
| 781 |
<list name="rule_name_dbus"><item>dbus</item></list> |
| 782 |
<list name="rule_name_unix"><item>unix</item></list> |
| 783 |
<list name="rule_name_link"><item>link</item></list> |
| 784 |
<list name="rule_name_changeprofile"><item>change_profile</item></list> |
| 785 |
<list name="rule_name_rlimit"><item>rlimit</item></list> |
| 786 |
<list name="rule_name_set"><item>set</item></list> |
| 787 |
|
| 788 |
<contexts> |
| 789 |
|
| 790 |
<context name="_normal" attribute="Normal Text" lineEndContext="#stay"> |
| 791 |
<!-- Preamble --> |
| 792 |
|
| 793 |
<!-- Variable Assignment. |
| 794 |
NOTE: |
| 795 |
- Variable assignments are not allowed within profiles (when writing assignments within |
| 796 |
profiles, the parser shows an error because it does not allow + or = after a variable). |
| 797 |
- [Jul 24, 2018] Variables of type "@VAR" will only be highlighted in assignments, as long |
| 798 |
as they are not fully supported (apparently, they will be used in conditional expressions). --> |
| 799 |
<Detect2Chars context="_variable_assignment" attribute="Variable" char="@" char1="{" lookAhead="true" firstNonSpace="true"/> |
| 800 |
<RegExpr context="_variable_assignment_operator" attribute="Variable" String="@&varName;(?=\s*(?:\+?\=|$|\s#))" firstNonSpace="true"/> |
| 801 |
<DetectChar context="_variable_assignment_line_general" attribute="Operator 1" char="=" firstNonSpace="true"/> |
| 802 |
<Detect2Chars context="_variable_assignment_line" attribute="Operator 1" char="+" char1="=" firstNonSpace="true"/> |
| 803 |
<!-- Alias rule --> |
| 804 |
<keyword context="_default_rule_with_comments" attribute="Rule" String="rule_name_alias" beginRegion="Rule"/> |
| 805 |
|
| 806 |
<!-- Profile Content (also highlight rules, for abstractions) --> |
| 807 |
<IncludeRules context="_default_profile"/> |
| 808 |
</context> |
| 809 |
|
| 810 |
<!-- Profile Content, within { ... } --> |
| 811 |
<context name="_profile" attribute="Normal Text" lineEndContext="#stay"> |
| 812 |
<DetectChar context="#pop" attribute="Operator 1" char="}" endRegion="Profile"/> |
| 813 |
<Detect2Chars context="_variable_assignment_error" attribute="Variable" char="@" char1="{" lookAhead="true" firstNonSpace="true"/> |
| 814 |
<IncludeRules context="_default_profile"/> |
| 815 |
<WordDetect context="#stay" attribute="Error" String="alias"/> <!-- rule_name_alias --> |
| 816 |
</context> |
| 817 |
|
| 818 |
<context name="_default_profile" attribute="Normal Text" lineEndContext="#stay"> |
| 819 |
<!-- Profile Header --> |
| 820 |
<keyword context="_profile_name" attribute="Profile Head" String="profile_head"/> |
| 821 |
<RegExpr context="_profile_name" attribute="Profile Head" String="(?:^|\s)\^(?=\S)"/> |
| 822 |
<keyword context="#stay" attribute="Option" String="profile_options"/> |
| 823 |
|
| 824 |
<!-- Line Rules --> |
| 825 |
<StringDetect context="_include" attribute="Preprocessor" String="#include" insensitive="true"/> |
| 826 |
<RegExpr context="_include" attribute="Preprocessor" String="(?:^|\s)include(?=\s)"/> |
| 827 |
<DetectChar context="_comment" attribute="Comment" char="#"/> |
| 828 |
|
| 829 |
<!-- Variables --> |
| 830 |
<Detect2Chars context="_variable" attribute="Variable" char="@" char1="{" lookAhead="true"/> |
| 831 |
<Detect2Chars context="_boolean" attribute="Variable" char="$" char1="{" lookAhead="true"/> |
| 832 |
<keyword context="#stay" attribute="Other Option" String="boolean" insensitive="true"/> |
| 833 |
<RegExpr context="#stay" attribute="Variable" String="\$&varName;(?=[\s\(\)\{\}"@\$#\=\+]|$)"/> |
| 834 |
|
| 835 |
<!-- Brackets --> |
| 836 |
<IncludeRules context="_brackets_error"/> <!-- {} --> |
| 837 |
<DetectChar context="_profile" attribute="Operator 1" char="{" beginRegion="Profile"/> |
| 838 |
<DetectChar context="_parentheses_block_profile" attribute="Normal Text" char="("/> |
| 839 |
<DetectChar context="_r_square_brackets" attribute="Globbing Brackets" char="["/> |
| 840 |
|
| 841 |
<!-- Rule Qualifiers --> |
| 842 |
<keyword context="#stay" attribute="Rule Access Qualifier" String="rule_access_qualifiers"/> |
| 843 |
<keyword context="#stay" attribute="Rule Qualifier" String="rule_qualifiers"/> |
| 844 |
<keyword context="#stay" attribute="File Rule Qualifier" String="file_rule_qualifiers"/> |
| 845 |
|
| 846 |
<!-- Rules --> |
| 847 |
<keyword context="_rule_abi" attribute="Rule" String="rule_name_abi" beginRegion="Rule"/> |
| 848 |
<keyword context="_rule_file" attribute="Rule" String="rule_name_file" beginRegion="Rule"/> |
| 849 |
<keyword context="_rule_mount" attribute="Rule" String="rule_name_mount" beginRegion="Rule"/> |
| 850 |
<keyword context="_rule_capability" attribute="Rule" String="rule_name_capability" beginRegion="Rule"/> |
| 851 |
<keyword context="_rule_network" attribute="Rule" String="rule_name_network" beginRegion="Rule"/> |
| 852 |
<keyword context="_rule_pivotroot" attribute="Rule" String="rule_name_pivotroot" beginRegion="Rule"/> |
| 853 |
<keyword context="_rule_ptrace" attribute="Rule" String="rule_name_ptrace" beginRegion="Rule"/> |
| 854 |
<keyword context="_rule_signal" attribute="Rule" String="rule_name_signal" beginRegion="Rule"/> |
| 855 |
<keyword context="_rule_dbus" attribute="Rule" String="rule_name_dbus" beginRegion="Rule"/> |
| 856 |
<keyword context="_rule_unix" attribute="Rule" String="rule_name_unix" beginRegion="Rule"/> |
| 857 |
<keyword context="_rule_link" attribute="Rule" String="rule_name_link" beginRegion="Rule"/> |
| 858 |
<keyword context="_rule_changeprofile" attribute="Rule" String="rule_name_changeprofile" beginRegion="Rule"/> |
| 859 |
<keyword context="_rule_rlimit" attribute="Rule Error" String="rule_name_rlimit" beginRegion="Rule"/> <!-- set rlimit --> |
| 860 |
<keyword context="_rule_set" attribute="Rule" String="rule_name_set"/> |
| 861 |
|
| 862 |
<!-- Paths, text in quotes, file permissions and others --> |
| 863 |
<IncludeRules context="_operators"/> |
| 864 |
<IncludeRules context="_find_path"/> |
| 865 |
<IncludeRules context="_find_text_quoted"/> |
| 866 |
<IncludeRules context="_file_rule_permissions"/> |
| 867 |
<keyword context="#stay" String="default_variables"/> |
| 868 |
</context> |
| 869 |
|
| 870 |
<!-- Within rules and blocks of parentheses --> |
| 871 |
<context name="_common" attribute="Normal Text" lineEndContext="#stay"> |
| 872 |
<StringDetect context="#stay" attribute="Error" String="#include" insensitive="true"/> |
| 873 |
<RegExpr context="#stay" attribute="Error" String="include(?=\s)" firstNonSpace="true"/> |
| 874 |
<IncludeRules context="_brackets_error"/> |
| 875 |
|
| 876 |
<IncludeRules context="_operators"/> |
| 877 |
<IncludeRules context="_find_text_quoted"/> |
| 878 |
<keyword context="#stay" attribute="Other Data" String="other_words" insensitive="true"/> |
| 879 |
<keyword context="#stay" attribute="Other Data" String="boolean" insensitive="true"/> |
| 880 |
</context> |
| 881 |
|
| 882 |
<!-- Comment --> |
| 883 |
<context name="_comment" attribute="Comment" lineEndContext="#pop"> |
| 884 |
<DetectSpaces /> |
| 885 |
<LineContinue context="#pop" attribute="Comment"/> |
| 886 |
<IncludeRules context="##Comments"/> |
| 887 |
<RegExpr context="#stay" attribute="URL in Comment" String="&url;|&email;"/> |
| 888 |
</context> |
| 889 |
|
| 890 |
<!-- Profile Header: |
| 891 |
Highlight the name of the profile. |
| 892 |
The profile name label is written after the hat character (^) or a profile keyword. |
| 893 |
AppArmor 3.0 deprecates the use of pathnames as the profiles name. --> |
| 894 |
<context name="_profile_name" attribute="Profile Name" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> |
| 895 |
<DetectSpaces context="#stay" attribute="Normal Text"/> |
| 896 |
<!-- Not highlighting paths and paths quoted. |
| 897 |
NOTE: Some profile labels may contain "/" (like [/]). These cases are not considered. --> |
| 898 |
<RegExpr context="#pop" attribute="Normal Text" String=""(?:[^/"\\]|\\.)*/" lookAhead="true"/> |
| 899 |
<RegExpr context="#pop!_path_content" attribute="Path" String="(?:[^\s"\\]|\\.)*/" lookAhead="true"/> |
| 900 |
<DetectChar context="#pop!_profile_name_quoted" attribute="Profile Name" char="""/> |
| 901 |
<!-- First word (the profile name) --> |
| 902 |
<RegExpr context="#pop!_profile_name_content" attribute="Normal Text" String="[^\s/\^\{]" lookAhead="true"/> |
| 903 |
</context> |
| 904 |
<context name="_profile_name_content" attribute="Profile Name" lineEndContext="#pop"> |
| 905 |
<!-- NOTE: "(" generates errors when calling "get_profiles()" (apparmor_status). This forces to put a space before. --> |
| 906 |
<RegExpr context="#pop" attribute="Error" String="\(\S*\)?"/> |
| 907 |
<!-- End of the profile name label --> |
| 908 |
<DetectSpaces context="#pop" attribute="Normal Text" lookAhead="true"/> |
| 909 |
<!-- The quote ends the profile name, but it is ideal to put a space before --> |
| 910 |
<DetectChar context="#pop" attribute="Normal Text" char=""" lookAhead="true"/> |
| 911 |
<RegExpr context="#stay" attribute="Profile Name Error" String="[^\s\(\\](?=["\(])"/> |
| 912 |
|
| 913 |
<StringDetect context="#pop" attribute="Error" String="#include" insensitive="true"/> |
| 914 |
<IncludeRules context="_variable_simple"/> |
| 915 |
<IncludeRules context="_escape"/> |
| 916 |
</context> |
| 917 |
<context name="_profile_name_quoted" attribute="Profile Name" lineEndContext="#stay"> |
| 918 |
<DetectChar context="#pop" attribute="Profile Name" char="""/> |
| 919 |
<IncludeRules context="_variable_simple"/> |
| 920 |
<IncludeRules context="_escape"/> |
| 921 |
</context> |
| 922 |
|
| 923 |
<!-- Include Rule: include <abstraction/path> --> |
| 924 |
<context name="_include" attribute="Preprocessor" lineEndContext="#pop"> |
| 925 |
<Detect2Chars context="#pop" attribute="Error" char=""" char1="""/> |
| 926 |
<Detect2Chars context="#pop" attribute="Error" char="<" char1=">"/> |
| 927 |
<RegExpr context="#stay" attribute="Error" String="<+(?=[<\s])"/> |
| 928 |
<RegExpr context="#pop!_include_preplib_thanquot" attribute="Prep. Lib" String="<\s*(?=")"/> <!-- <"path"> --> |
| 929 |
<DetectChar context="#pop!_include_preplib_than" attribute="Prep. Lib" char="<" lookAhead="true"/> <!-- <magic/path> --> |
| 930 |
<DetectChar context="#pop!_include_preplib_quot" attribute="Prep. Lib" char="""/> <!-- "/abs/path" --> |
| 931 |
<keyword context="#stay" attribute="Preprocessor" String="rule_include"/> |
| 932 |
<RegExpr context="#pop" attribute="Prep. Lib" String="[^\s/"<>]*/\S*(?=\s|$)"/> <!-- /abs/path --> |
| 933 |
</context> |
| 934 |
<context name="_include_preplib_than" attribute="Prep. Lib" lineEndContext="#pop"> |
| 935 |
<DetectChar context="#pop" attribute="Prep. Lib" char=">"/> |
| 936 |
<keyword context="#stay" attribute="Prep. Lib" String="default_abstractions"/> |
| 937 |
<RegExpr context="#pop" attribute="Open Prep. Lib" String="[^>\s](?=\s*$)"/> |
| 938 |
</context> |
| 939 |
<context name="_include_preplib_quot" attribute="Prep. Lib" lineEndContext="#pop"> |
| 940 |
<DetectChar context="#pop" attribute="Prep. Lib" char="""/> |
| 941 |
<keyword context="#stay" attribute="Prep. Lib" String="default_abstractions"/> |
| 942 |
<RegExpr context="#pop" attribute="Open Prep. Lib" String="[^"\s](?=\s*$)"/> |
| 943 |
</context> |
| 944 |
<context name="_include_preplib_thanquot" attribute="Prep. Lib" lineEndContext="#pop"> |
| 945 |
<DetectChar context="_include_preplib_quot" attribute="Prep. Lib" char="""/> |
| 946 |
<IncludeRules context="_include_preplib_than"/> |
| 947 |
</context> |
| 948 |
|
| 949 |
<!-- ABI Rule --> |
| 950 |
<context name="_rule_abi" attribute="Error" lineEndContext="#stay"> |
| 951 |
<DetectSpaces attribute="Normal Text"/> |
| 952 |
<RegExpr context="#pop!_abi_path_thanquot" attribute="Prep. Lib" String="<\s*(?=")"/> <!-- <"path"> --> |
| 953 |
<DetectChar context="#pop!_abi_path_than" attribute="Prep. Lib" char="<" lookAhead="true"/> <!-- <magic/path> --> |
| 954 |
<DetectChar context="#pop!_abi_path_quot" attribute="Prep. Lib" char="""/> <!-- "/abs/path" --> |
| 955 |
<IncludeRules context="_end_rule"/> |
| 956 |
<DetectChar context="_comment" attribute="Comment" char="#"/> |
| 957 |
<!-- /abs/path --> |
| 958 |
<RegExpr context="#stay" attribute="Error" String="[^\s"<]+(?=["<])"/> |
| 959 |
<RegExpr context="#pop!_abi_path_text" attribute="Prep. Lib" String="[^\s"<]" lookAhead="true"/> |
| 960 |
</context> |
| 961 |
|
| 962 |
<context name="_abi_path_text" attribute="Prep. Lib" lineEndContext="#pop!_rule_abi_after_path"> |
| 963 |
<RegExpr context="#pop!_rule_abi_after_path" String="&endPath;" lookAhead="true"/> |
| 964 |
<DetectSpaces context="#pop!_rule_abi_after_path" lookAhead="true"/> |
| 965 |
<AnyChar context="#stay" attribute="Error" String=""<>"/> |
| 966 |
</context> |
| 967 |
<context name="_abi_path_quot" attribute="Prep. Lib" lineEndContext="#stay"> |
| 968 |
<DetectChar context="#pop!_rule_abi_after_path" attribute="Prep. Lib" char="""/> |
| 969 |
<IncludeRules context="_escape"/> |
| 970 |
</context> |
| 971 |
<context name="_abi_path_than" attribute="Prep. Lib" lineEndContext="#pop!_rule_abi_after_path"> |
| 972 |
<DetectChar context="#pop!_rule_abi_after_path" attribute="Prep. Lib" char=">"/> |
| 973 |
<RegExpr context="#pop!_rule_abi_after_path" attribute="Open Prep. Lib" String="[^>\s](?=\s*$)"/> |
| 974 |
</context> |
| 975 |
<context name="_abi_path_thanquot" attribute="Prep. Lib" lineEndContext="#pop!_rule_abi_after_path"> |
| 976 |
<DetectChar context="_abi_path_thanquot_quot" attribute="Prep. Lib" char="""/> |
| 977 |
<IncludeRules context="_abi_path_than"/> |
| 978 |
</context> |
| 979 |
<context name="_abi_path_thanquot_quot" attribute="Prep. Lib" lineEndContext="#stay"> |
| 980 |
<DetectChar context="#pop" attribute="Prep. Lib" char="""/> |
| 981 |
<IncludeRules context="_escape"/> |
| 982 |
</context> |
| 983 |
|
| 984 |
<context name="_rule_abi_after_path" attribute="Error" lineEndContext="#stay"> |
| 985 |
<DetectSpaces attribute="Normal Text"/> |
| 986 |
<IncludeRules context="_end_rule"/> |
| 987 |
<DetectChar context="_comment" attribute="Comment" char="#"/> |
| 988 |
</context> |
| 989 |
|
| 990 |
<!-- @{VARIABLE} --> |
| 991 |
<context name="_variable" attribute="Variable" lineEndContext="#pop"> |
| 992 |
<RegExpr context="#pop!_find_path_after_variable" attribute="Variable" String="&variable;"/> |
| 993 |
<DetectChar context="#pop" attribute="Error" char="@"/> |
| 994 |
</context> |
| 995 |
<context name="_parentheses_variable" attribute="Variable" lineEndContext="#pop"> |
| 996 |
<RegExpr context="#pop!_parentheses_find_path_after_variable" attribute="Variable" String="&variable;"/> |
| 997 |
<DetectChar context="#pop" attribute="Error" char="@"/> |
| 998 |
</context> |
| 999 |
<context name="_variable_simple" attribute="Normal Text" lineEndContext="#stay"> |
| 1000 |
<RegExpr context="#stay" attribute="Variable" String="&variable;"/> |
| 1001 |
</context> |
| 1002 |
|
| 1003 |
<!-- Find path after a variable --> |
| 1004 |
<context name="_find_path_after_variable" attribute="Path" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!_path_content"> |
| 1005 |
<DetectSpaces context="#pop" lookAhead="true"/> |
| 1006 |
<AnyChar context="#pop" String="&noPathCharWithoutSpace;]}=" lookAhead="true"/> |
| 1007 |
<RegExpr context="#pop" String="[[:cntrl:]]" lookAhead="true"/> <!-- It is necessary? --> |
| 1008 |
</context> |
| 1009 |
<context name="_parentheses_find_path_after_variable" attribute="Path" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!_parentheses_path_content"> |
| 1010 |
<DetectChar context="#pop" char="," lookAhead="true"/> |
| 1011 |
<IncludeRules context="_find_path_after_variable"/> |
| 1012 |
</context> |
| 1013 |
|
| 1014 |
<!-- @{VARIABLE} = A B C --> |
| 1015 |
<context name="_variable_assignment" attribute="Variable" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> |
| 1016 |
<RegExpr context="#pop!_variable_assignment_operator" attribute="Variable" String="&variable;"/> |
| 1017 |
<DetectChar context="#pop" attribute="Error" char="@"/> |
| 1018 |
</context> |
| 1019 |
<context name="_variable_assignment_operator" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!_path_content"> |
| 1020 |
<!-- After the operator, highlighting as "Path" the entire line --> |
| 1021 |
<RegExpr context="#pop!_variable_assignment_line" attribute="Operator 1" String="\s*\+?\="/> |
| 1022 |
<DetectChar context="#pop!_path_content" attribute="Error" char="+"/> |
| 1023 |
<IncludeRules context="_find_path_after_variable"/> |
| 1024 |
</context> |
| 1025 |
<context name="_variable_assignment_line" attribute="Path" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!_variable_assignment_line_content"> |
| 1026 |
<DetectChar context="#pop!_variable_assignment_line_content" attribute="Error" char="#"/> <!-- Comment --> |
| 1027 |
</context> |
| 1028 |
<context name="_variable_assignment_line_content" attribute="Path" lineEndContext="#pop"> |
| 1029 |
<LineContinue context="#stay" attribute="Escape Char"/> |
| 1030 |
<IncludeRules context="_path_globbing"/> |
| 1031 |
<IncludeRules context="_find_text_quoted"/> |
| 1032 |
<IncludeRules context="_variable_simple"/> |
| 1033 |
<Detect2Chars context="_hat_path" char="/" char1="/" lookAhead="true"/> |
| 1034 |
<RegExpr context="#stay" attribute="Error" String=",(?=[\s"]|$)"/> <!-- End of rule comma (&endPath;) --> |
| 1035 |
<StringDetect context="#stay" attribute="Error" String="#include" insensitive="true"/> |
| 1036 |
|
| 1037 |
<!-- NOTE: [V4][Jan 06, 2018] AppArmor does not detect comments in variable assignment lines |
| 1038 |
(these are carried through to the policy). This is an AppArmor bug, therefore, the hash |
| 1039 |
character after a space is highlighted as "Error". Check this when the bug has been fixed. --> |
| 1040 |
<RegExpr context="_comment_variable_assignment_line" attribute="Path" String="\s(?=#)"/> |
| 1041 |
</context> |
| 1042 |
<context name="_comment_variable_assignment_line" attribute="Error" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> |
| 1043 |
<DetectChar context="#pop" attribute="Error" char="#"/> |
| 1044 |
</context> |
| 1045 |
<context name="_variable_assignment_line_general" attribute="Path" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!_variable_assignment_line"> |
| 1046 |
<keyword context="#pop!_variable_assignment_line" attribute="Other Option" String="boolean" insensitive="true"/> |
| 1047 |
<DetectSpaces context="#stay"/> |
| 1048 |
</context> |
| 1049 |
|
| 1050 |
<!-- Within the profiles, highlight as "Error" the operators of variable assignment (= and +=) --> |
| 1051 |
<context name="_variable_assignment_error" attribute="Variable" lineEndContext="#pop"> |
| 1052 |
<RegExpr context="#pop!_variable_assignment_error_operator" attribute="Variable" String="&variable;"/> |
| 1053 |
<DetectChar context="#pop" attribute="Error" char="@"/> |
| 1054 |
</context> |
| 1055 |
<context name="_variable_assignment_error_operator" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!_find_path_after_variable"> |
| 1056 |
<DetectChar context="#pop!_find_path_after_variable" attribute="Error" char="="/> |
| 1057 |
<Detect2Chars context="#pop!_find_path_after_variable" attribute="Error" char="+" char1="="/> |
| 1058 |
<RegExpr context="#pop!_variable_assignment_error_operator_after_spaces" String="\s+(?=\+?\=)"/> |
| 1059 |
</context> |
| 1060 |
<context name="_variable_assignment_error_operator_after_spaces" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> |
| 1061 |
<DetectChar context="#pop" attribute="Error" char="="/> |
| 1062 |
<Detect2Chars context="#pop" attribute="Error" char="+" char1="="/> |
| 1063 |
</context> |
| 1064 |
|
| 1065 |
<!-- ${BOOLEAN} --> |
| 1066 |
<context name="_boolean" attribute="Variable" lineEndContext="#pop"> |
| 1067 |
<RegExpr context="#pop" attribute="Variable" String="\$\{&varName;\}"/> |
| 1068 |
<DetectChar context="#pop" attribute="Error" char="$"/> |
| 1069 |
</context> |
| 1070 |
|
| 1071 |
<!-- Access Modes / File Permissions --> |
| 1072 |
<context name="_permissions" attribute="Normal Text" lineEndContext="#stay"> |
| 1073 |
<IncludeRules context="_permissions_correction"/> |
| 1074 |
<RegExpr context="#stay" attribute="Permissions" String="(?:^|\s)(?:(?:[rwkml]|&exec;)+|(?:[rakml]|&exec;)+)(?=[\s,]|$)"/> |
| 1075 |
</context> |
| 1076 |
<context name="_file_rule_permissions" attribute="Normal Text" lineEndContext="#stay"> |
| 1077 |
<IncludeRules context="_permissions_correction"/> |
| 1078 |
<RegExpr context="_rule_file" attribute="Permissions" String="(?:^|\s)(?:(?:[rwkml]|&exec;)+|(?:[rakml]|&exec;)+)(?=[\s,]|$)"/> |
| 1079 |
</context> |
| 1080 |
<context name="_permissions_correction" attribute="Normal Text" lineEndContext="#stay"> |
| 1081 |
<!-- Incompatible execution modes --> |
| 1082 |
<RegExpr context="_perm_correction_in" String="&perm_correction_in;" lookAhead="true" minimal="1"/> |
| 1083 |
</context> |
| 1084 |
<context name="_perm_correction_in" attribute="Normal Text" lineEndContext="#pop"> |
| 1085 |
<!-- Highlight the previous space or the full permission --> |
| 1086 |
<DetectSpaces context="#pop"/> |
| 1087 |
<DetectIdentifier context="#pop"/> |
| 1088 |
</context> |
| 1089 |
|
| 1090 |
<!-- Operators --> |
| 1091 |
<context name="_operators" attribute="Normal Text" lineEndContext="#stay"> |
| 1092 |
<DetectChar context="#stay" attribute="Operator 1" char="="/> |
| 1093 |
<Detect2Chars context="#stay" attribute="Operator 1" char="+" char1="="/> |
| 1094 |
<Detect2Chars context="#stay" attribute="Operator 2" char="-" char1=">"/> |
| 1095 |
</context> |
| 1096 |
<context name="_operators_in" attribute="Normal Text" lineEndContext="#stay"> |
| 1097 |
<!-- Only in mount rules --> |
| 1098 |
<RegExpr context="#stay" attribute="Operator 2" String="\b(?:in)(?=[\s\(\{\["/@\$]|$)"/> |
| 1099 |
</context> |
| 1100 |
|
| 1101 |
<!-- RULES --> |
| 1102 |
|
| 1103 |
<!-- For all rules --> |
| 1104 |
<!-- Also see: _default_parentheses_block_rule --> |
| 1105 |
<context name="_common_rule" attribute="Normal Text" lineEndContext="#stay"> |
| 1106 |
<!-- Highlight as path the text after the '=' operator, except keywords or simple words ([\w\-\+]+) --> |
| 1107 |
<RegExpr context="#stay" attribute="Error" String="\=(?=\s*(?:$|&endPath;))"/> |
| 1108 |
<RegExpr context="_path_content" attribute="Operator 1" String="\=\s*(?=[^\s"\(]*(?:[^&noPathChar;\]\}\=\w\+\-\(,]|,[^&noPathChar;]))"/> |
| 1109 |
<Detect2Chars context="_variable" attribute="Variable" char="@" char1="{" lookAhead="true"/> |
| 1110 |
<IncludeRules context="_find_path"/> |
| 1111 |
|
| 1112 |
<IncludeRules context="_common"/> |
| 1113 |
<DetectChar context="_r_curly_brackets" attribute="Globbing Brackets" char="{"/> |
| 1114 |
<DetectChar context="_r_square_brackets" attribute="Globbing Brackets" char="["/> |
| 1115 |
<!-- This must be at the end of each context (to avoid conflicts with some keywords) --> |
| 1116 |
<IncludeRules context="_end_rule"/> |
| 1117 |
</context> |
| 1118 |
<context name="_default_rule_without_parentheses" attribute="Normal Text" lineEndContext="#stay"> |
| 1119 |
<IncludeRules context="_common_rule"/> |
| 1120 |
<!-- AppArmor does not detect comments within rules (except in file & alias rules) --> |
| 1121 |
<IncludeRules context="_comment_not_allowed"/> |
| 1122 |
</context> |
| 1123 |
<context name="_default_rule" attribute="Normal Text" lineEndContext="#stay"> |
| 1124 |
<IncludeRules context="_default_rule_without_parentheses"/> |
| 1125 |
<DetectChar context="_default_parentheses_block_rule" attribute="Normal Text" char="("/> |
| 1126 |
</context> |
| 1127 |
<context name="_default_rule_with_comments" attribute="Normal Text" lineEndContext="#stay"> |
| 1128 |
<IncludeRules context="_common_rule"/> |
| 1129 |
<DetectChar context="_comment" attribute="Comment" char="#"/> |
| 1130 |
</context> |
| 1131 |
|
| 1132 |
<context name="_comment_not_allowed" attribute="Normal Text" lineEndContext="#stay"> |
| 1133 |
<DetectChar context="_comment" attribute="Error" char="#" firstNonSpace="true"/> |
| 1134 |
<DetectChar context="#stay" attribute="Error" char="#"/> |
| 1135 |
</context> |
| 1136 |
|
| 1137 |
<!-- Network Rule --> |
| 1138 |
<context name="_rule_network" attribute="Normal Text" lineEndContext="#stay"> |
| 1139 |
<keyword context="#stay" attribute="Data" String="rule_network"/> |
| 1140 |
<keyword context="#stay" attribute="Data" String="rule_network_unix"/> |
| 1141 |
<IncludeRules context="_default_rule"/> |
| 1142 |
</context> |
| 1143 |
|
| 1144 |
<!-- Capability Rule --> |
| 1145 |
<context name="_rule_capability" attribute="Normal Text" lineEndContext="#stay"> |
| 1146 |
<keyword context="#stay" attribute="Data" String="rule_capability"/> |
| 1147 |
<IncludeRules context="_default_rule"/> |
| 1148 |
</context> |
| 1149 |
|
| 1150 |
<!-- Mount Rule --> |
| 1151 |
<context name="_rule_mount" attribute="Normal Text" lineEndContext="#stay"> |
| 1152 |
<keyword context="#stay" attribute="Option" String="rule_mount_options"/> |
| 1153 |
<IncludeRules context="_mount_rule_keywords"/> |
| 1154 |
<IncludeRules context="_default_rule_without_parentheses"/> |
| 1155 |
<DetectChar context="_mount_parentheses_block" attribute="Normal Text" char="("/> |
| 1156 |
</context> |
| 1157 |
<context name="_mount_parentheses_block" attribute="Normal Text" lineEndContext="#stay"> |
| 1158 |
<IncludeRules context="_mount_rule_keywords"/> |
| 1159 |
<IncludeRules context="_default_parentheses_block_rule"/> |
| 1160 |
</context> |
| 1161 |
<context name="_mount_rule_keywords" attribute="Normal Text" lineEndContext="#stay"> |
| 1162 |
<keyword context="#stay" attribute="Permissions" String="rule_mount_flags"/> |
| 1163 |
<keyword context="#stay" attribute="Flags" String="rule_mount_fstypes"/> |
| 1164 |
<IncludeRules context="_operators_in"/> |
| 1165 |
</context> |
| 1166 |
|
| 1167 |
<!-- Pivot Root Rule --> |
| 1168 |
<context name="_rule_pivotroot" attribute="Normal Text" lineEndContext="#stay"> |
| 1169 |
<keyword context="#stay" attribute="Option" String="rule_pivotroot_options"/> |
| 1170 |
<IncludeRules context="_default_rule"/> |
| 1171 |
</context> |
| 1172 |
|
| 1173 |
<!-- Ptrace Rule --> |
| 1174 |
<context name="_rule_ptrace" attribute="Normal Text" lineEndContext="#stay"> |
| 1175 |
<keyword context="#stay" attribute="Option" String="rule_ptrace_options"/> |
| 1176 |
<IncludeRules context="_ptrace_rule_keywords"/> |
| 1177 |
<IncludeRules context="_default_rule_without_parentheses"/> |
| 1178 |
<DetectChar context="_ptrace_parentheses_block" attribute="Normal Text" char="("/> |
| 1179 |
</context> |
| 1180 |
<context name="_ptrace_parentheses_block" attribute="Normal Text" lineEndContext="#stay"> |
| 1181 |
<keyword context="#stay" attribute="Other Option" String="rule_ptrace_options"/> |
| 1182 |
<IncludeRules context="_ptrace_rule_keywords"/> |
| 1183 |
<IncludeRules context="_default_parentheses_block_rule"/> |
| 1184 |
</context> |
| 1185 |
<context name="_ptrace_rule_keywords" attribute="Normal Text" lineEndContext="#stay"> |
| 1186 |
<keyword context="#stay" attribute="Permissions" String="rule_ptrace_access"/> |
| 1187 |
<keyword context="#stay" attribute="Permissions" String="base_accesses"/> |
| 1188 |
</context> |
| 1189 |
|
| 1190 |
<!-- Signal Rule --> |
| 1191 |
<context name="_rule_signal" attribute="Normal Text" lineEndContext="#stay"> |
| 1192 |
<keyword context="#stay" attribute="Option" String="rule_signal_options"/> |
| 1193 |
<IncludeRules context="_signal_rule_keywords"/> |
| 1194 |
<IncludeRules context="_default_rule_without_parentheses"/> |
| 1195 |
<DetectChar context="_signal_parentheses_block" attribute="Normal Text" char="("/> |
| 1196 |
</context> |
| 1197 |
<context name="_signal_parentheses_block" attribute="Normal Text" lineEndContext="#stay"> |
| 1198 |
<IncludeRules context="_signal_rule_keywords"/> |
| 1199 |
<keyword context="#stay" attribute="Other Option" String="rule_signal_options"/> |
| 1200 |
<IncludeRules context="_default_parentheses_block_rule"/> |
| 1201 |
</context> |
| 1202 |
<context name="_signal_rule_keywords" attribute="Normal Text" lineEndContext="#stay"> |
| 1203 |
<keyword context="#stay" attribute="Flags" String="rule_signal"/> |
| 1204 |
<keyword context="#stay" attribute="Permissions" String="rule_signal_access"/> |
| 1205 |
<keyword context="#stay" attribute="Permissions" String="base_accesses"/> |
| 1206 |
<RegExpr context="#stay" attribute="Flags" String="\brtmin\+0*(?:3[012]|[12]?\d)\b"/> <!-- rtmin+0 ... rtmin+32 --> |
| 1207 |
</context> |
| 1208 |
|
| 1209 |
<!-- DBus Rule --> |
| 1210 |
<context name="_rule_dbus" attribute="Normal Text" lineEndContext="#stay"> |
| 1211 |
<keyword context="#stay" attribute="Option" String="rule_dbus_options"/> |
| 1212 |
<IncludeRules context="_dbus_rule_keywords"/> |
| 1213 |
<IncludeRules context="_default_rule_without_parentheses"/> |
| 1214 |
<DetectChar context="_dbus_parentheses_block" attribute="Normal Text" char="("/> |
| 1215 |
</context> |
| 1216 |
<context name="_dbus_parentheses_block" attribute="Normal Text" lineEndContext="#stay"> |
| 1217 |
<keyword context="#stay" attribute="Other Option" String="rule_dbus_peer"/> |
| 1218 |
<IncludeRules context="_dbus_rule_keywords"/> |
| 1219 |
<IncludeRules context="_default_parentheses_block_rule"/> |
| 1220 |
</context> |
| 1221 |
<context name="_dbus_rule_keywords" attribute="Normal Text" lineEndContext="#stay"> |
| 1222 |
<keyword context="#stay" attribute="Other Data" String="rule_dbus_bus"/> |
| 1223 |
<keyword context="#stay" attribute="Permissions" String="rule_dbus_access"/> |
| 1224 |
<keyword context="#stay" attribute="Permissions" String="base_accesses"/> |
| 1225 |
</context> |
| 1226 |
|
| 1227 |
<!-- Unix Rule --> |
| 1228 |
<context name="_rule_unix" attribute="Normal Text" lineEndContext="#stay"> |
| 1229 |
<keyword context="#stay" attribute="Option" String="rule_unix_options"/> |
| 1230 |
<IncludeRules context="_unix_rule_keywords"/> |
| 1231 |
<IncludeRules context="_default_rule_without_parentheses"/> |
| 1232 |
<DetectChar context="_path_content" attribute="Path" char="@" lookAhead="true"/> <!-- Socket --> |
| 1233 |
<DetectChar context="_unix_parentheses_block" attribute="Normal Text" char="("/> |
| 1234 |
</context> |
| 1235 |
<context name="_unix_parentheses_block" attribute="Normal Text" lineEndContext="#stay"> |
| 1236 |
<IncludeRules context="_unix_rule_keywords"/> |
| 1237 |
<keyword context="#stay" attribute="Other Option" String="rule_unix_options"/> |
| 1238 |
<IncludeRules context="_default_parentheses_block_rule"/> |
| 1239 |
<DetectChar context="_parentheses_path_content" attribute="Path" char="@" lookAhead="true"/> |
| 1240 |
</context> |
| 1241 |
<context name="_unix_rule_keywords" attribute="Normal Text" lineEndContext="#stay"> |
| 1242 |
<keyword context="#stay" attribute="Permissions" String="rule_unix_access"/> |
| 1243 |
<keyword context="#stay" attribute="Permissions" String="base_accesses"/> |
| 1244 |
<keyword context="#stay" attribute="Data" String="rule_network"/> |
| 1245 |
</context> |
| 1246 |
|
| 1247 |
<!-- Rlimit Rule --> |
| 1248 |
<context name="_rule_set" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> |
| 1249 |
<keyword context="#pop!_rule_rlimit" attribute="Rule" String="rule_name_rlimit" beginRegion="Rule"/> |
| 1250 |
<DetectSpaces context="#stay" attribute="Normal Text"/> |
| 1251 |
<RegExpr context="_comment" attribute="Comment" String="#(?!include)" insensitive="true"/> |
| 1252 |
</context> |
| 1253 |
<context name="_rule_rlimit" attribute="Normal Text" lineEndContext="#stay"> |
| 1254 |
<keyword context="#stay" attribute="Data" String="rule_rlimit"/> |
| 1255 |
<Detect2Chars context="#stay" attribute="Operator 2" char="<" char1="="/> |
| 1256 |
<RegExpr context="#stay" attribute="Number" String="\-(?:20|1?\d)\b"/> |
| 1257 |
<RegExpr context="_number_unit" attribute="Number" String="\b\d+"/> <!-- Rules Int don't use '-' as a delimiter --> |
| 1258 |
<WordDetect context="#stay" attribute="Number" String="infinity"/> |
| 1259 |
<RegExpr context="#stay" attribute="Numerical Unit" String="\b(?:[KMG]B?|[shd]|us|ms|min|sec|(?:minute|day|hour|week|second)(?:s?)|(?:milli|micro)second(?:s?))\b"/> |
| 1260 |
<IncludeRules context="_default_rule"/> |
| 1261 |
</context> |
| 1262 |
<context name="_number_unit" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> |
| 1263 |
<RegExpr context="#pop" attribute="Numerical Unit" String="(?:[KMG]B?|[shd]|us|ms|min|sec|(?:minute|day|hour|week|second)(?:s?)|(?:milli|micro)second(?:s?))\b"/> |
| 1264 |
</context> |
| 1265 |
|
| 1266 |
<!-- Link Rule --> |
| 1267 |
<context name="_rule_link" attribute="Normal Text" lineEndContext="#stay"> |
| 1268 |
<keyword context="#stay" attribute="Data" String="rule_link"/> |
| 1269 |
<IncludeRules context="_default_rule"/> |
| 1270 |
</context> |
| 1271 |
|
| 1272 |
<!-- Change Profile Rule --> |
| 1273 |
<context name="_rule_changeprofile" attribute="Normal Text" lineEndContext="#stay"> |
| 1274 |
<Detect2Chars context="#pop!_profile_transition" attribute="Operator 2" char="-" char1=">"/> |
| 1275 |
<keyword context="#stay" attribute="Data" String="rule_changeprofile"/> |
| 1276 |
<IncludeRules context="_default_rule"/> |
| 1277 |
</context> |
| 1278 |
|
| 1279 |
<!-- File Rule --> |
| 1280 |
<context name="_rule_file" attribute="Normal Text" lineEndContext="#stay"> |
| 1281 |
<Detect2Chars context="#pop!_profile_transition" attribute="Operator 2" char="-" char1=">"/> |
| 1282 |
<IncludeRules context="_default_rule_with_comments"/> |
| 1283 |
<IncludeRules context="_permissions"/> |
| 1284 |
</context> |
| 1285 |
|
| 1286 |
<!-- Profile Transition: |
| 1287 |
Highlight the profile name in File Rules (Execute Mode) and Change Profile Rules. --> |
| 1288 |
<context name="_profile_transition" attribute="Transition Profile Name" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> |
| 1289 |
<DetectSpaces context="#stay" attribute="Normal Text"/> |
| 1290 |
<!-- Not highlighting paths and paths quoted --> |
| 1291 |
<RegExpr context="#pop!_default_rule_with_comments" String="&path;" lookAhead="1"/> |
| 1292 |
|
| 1293 |
<DetectChar context="#pop!_t_profile_name_quoted" attribute="Transition Profile Name" char="""/> |
| 1294 |
<RegExpr context="#pop!_profile_transition_content" attribute="Normal Text" String="[^\s/]" lookAhead="true"/> <!-- First word --> |
| 1295 |
</context> |
| 1296 |
<context name="_profile_transition_content" attribute="Transition Profile Name" lineEndContext="#pop!_default_rule_with_comments"> |
| 1297 |
<RegExpr context="#pop!_default_rule_with_comments" attribute="Error" String="\(\S*(?=,(?:[&noPathChar;]|$))"/> |
| 1298 |
<RegExpr context="#pop!_default_rule_with_comments" attribute="Normal Text" String="&endPath;" lookAhead="true"/> <!-- End rule --> |
| 1299 |
<DetectSpaces context="#pop" attribute="Normal Text" lookAhead="true"/> <!-- End of the profile name --> |
| 1300 |
|
| 1301 |
<DetectChar context="#stay" attribute="Error" char="""/> |
| 1302 |
<StringDetect context="#pop!_default_rule_with_comments" attribute="Error" String="#include" insensitive="true"/> |
| 1303 |
<RegExpr context="#stay" String="//(?=&endPath;)"/> |
| 1304 |
<IncludeRules context="_default_profile_transition"/> |
| 1305 |
</context> |
| 1306 |
<context name="_t_profile_name_quoted" attribute="Transition Profile Name" lineEndContext="#pop!_default_rule_with_comments"> |
| 1307 |
<DetectChar context="#pop!_default_rule_with_comments" attribute="Transition Profile Name" char="""/> |
| 1308 |
<IncludeRules context="_default_profile_transition"/> |
| 1309 |
</context> |
| 1310 |
<context name="_default_profile_transition" attribute="Transition Profile Name" lineEndContext="#stay"> |
| 1311 |
<IncludeRules context="_variable_simple"/> |
| 1312 |
<AnyChar context="#stay" attribute="Globbing Char in Tran. Prof." String="&globbChars;"/> |
| 1313 |
<IncludeRules context="_profile_transition_escape"/> |
| 1314 |
<RegExpr context="#stay" attribute="Hat Operator in Tran. Prof." String="//(?=[^&noPathChar;/])"/> |
| 1315 |
</context> |
| 1316 |
|
| 1317 |
<!-- Change Hat / Child Profile (name//HAT). |
| 1318 |
NOTE: Old style (name^HAT) not included --> |
| 1319 |
<context name="_hat_path" attribute="Path" lineEndContext="#pop"> |
| 1320 |
<RegExpr context="#pop" attribute="Path" String="/(?=/&endPath;)"/> |
| 1321 |
<RegExpr context="#pop!_hat_path_content" attribute="SubProfile/Hat Operator" String="//(?=(?:[^\s"/\\]|\\.)+(?:[\s"]|$))"/> |
| 1322 |
<DetectChar context="#pop" attribute="Path" char="/"/> |
| 1323 |
</context> |
| 1324 |
<context name="_hat_path_parentheses" attribute="Path" lineEndContext="#pop"> |
| 1325 |
<RegExpr context="#pop!_hat_path_parentheses_content" attribute="SubProfile/Hat Operator" String="//(?=(?:[^&noPathChar;/\\,]|\\.)+(?:[&noPathChar;,]|$))"/> |
| 1326 |
<DetectChar context="#pop" attribute="Path" char="/"/> |
| 1327 |
</context> |
| 1328 |
<context name="_hat_path_quoted" attribute="Text Quoted" lineEndContext="#pop"> |
| 1329 |
<RegExpr context="#pop!_hat_path_quoted_content" attribute="SubProfile/Hat Operator" String="//(?=(?:[^"/\\]|\\.)+")"/> |
| 1330 |
<DetectChar context="#pop" attribute="Text Quoted" char="/"/> |
| 1331 |
</context> |
| 1332 |
|
| 1333 |
<context name="_hat_path_content" attribute="SubProfile/Hat" lineEndContext="#pop"> |
| 1334 |
<RegExpr context="#pop" String="&endPath;" lookAhead="true"/> <!-- End Path --> |
| 1335 |
<IncludeRules context="_default_path"/> |
| 1336 |
</context> |
| 1337 |
<context name="_hat_path_parentheses_content" attribute="SubProfile/Hat" lineEndContext="#pop"> |
| 1338 |
<DetectChar context="#pop" char="," lookAhead="true"/> <!-- End Path --> |
| 1339 |
<IncludeRules context="_default_path"/> |
| 1340 |
</context> |
| 1341 |
<context name="_hat_path_quoted_content" attribute="SubProfile/Hat" lineEndContext="#pop"> |
| 1342 |
<DetectChar context="#pop" char=""" lookAhead="true"/> |
| 1343 |
<IncludeRules context="_default_quoted"/> |
| 1344 |
</context> |
| 1345 |
|
| 1346 |
<!-- Parentheses Block: ( ) |
| 1347 |
NOTE: Here special contexts are used for paths, strings and brackets. The "," character acts as a delimiter. --> |
| 1348 |
<context name="_common_parentheses_block" attribute="Normal Text" lineEndContext="#stay"> |
| 1349 |
<DetectChar context="#pop" attribute="Normal Text" char=")"/> |
| 1350 |
<!-- Highlight as path the text after the '=' operator, except keywords or simple words ([\w\-\+]+) --> |
| 1351 |
<RegExpr context="#stay" attribute="Error" String="\=(?=\s*(?:$|[,\)]))"/> |
| 1352 |
<RegExpr context="_parentheses_path_content" attribute="Operator 1" String="\=\s*(?=[^\s"\(\),]*[^&noPathChar;\]\}\=\w\+\-\(,])"/> |
| 1353 |
<DetectChar context="_parentheses_path_content" attribute="Path" char="/" lookAhead="true"/> |
| 1354 |
<Detect2Chars context="_parentheses_variable" attribute="Variable" char="@" char1="{" lookAhead="true"/> |
| 1355 |
|
| 1356 |
<IncludeRules context="_common"/> |
| 1357 |
<DetectChar context="_round_brackets" attribute="Globbing Brackets" char="("/> |
| 1358 |
<DetectChar context="_p_curly_brackets" attribute="Globbing Brackets" char="{"/> |
| 1359 |
<DetectChar context="_p_square_brackets" attribute="Globbing Brackets" char="["/> |
| 1360 |
<IncludeRules context="_comment_not_allowed"/> |
| 1361 |
</context> |
| 1362 |
<context name="_parentheses_block_profile" attribute="Normal Text" lineEndContext="#stay"> |
| 1363 |
<keyword context="#stay" attribute="Flags" String="profile_flags"/> |
| 1364 |
<!-- Used by xattrs --> |
| 1365 |
<RegExpr context="#stay" attribute="Other Option" String="\b[a-zA-Z](?:\.?[\w\-])*(?=\s*\=)"/> |
| 1366 |
<IncludeRules context="_common_parentheses_block"/> |
| 1367 |
<IncludeRules context="_end_rule_irnc"/> |
| 1368 |
</context> |
| 1369 |
<!-- Parentheses Block within Rules --> |
| 1370 |
<context name="_default_parentheses_block_rule" attribute="Normal Text" lineEndContext="#stay"> |
| 1371 |
<IncludeRules context="_common_parentheses_block"/> |
| 1372 |
<IncludeRules context="_end_rule_irnc_parentheses_rule"/> |
| 1373 |
</context> |
| 1374 |
|
| 1375 |
<!-- Finding the end of a rule --> |
| 1376 |
<context name="_end_rule" attribute="Normal Text" lineEndContext="#stay"> |
| 1377 |
<RegExpr context="#stay" attribute="Normal Text" String=",(?=\)|[\w\-]+[^\s\w\-,#\("])"/> <!-- Fix possible incorrect rule closures --> |
| 1378 |
<DetectChar context="#pop" attribute="End of Rule Char" char="," endRegion="Rule"/> |
| 1379 |
<IncludeRules context="_end_rule_irnc"/> |
| 1380 |
</context> |
| 1381 |
<!-- Rule/Profile on new line, in rule not closed --> |
| 1382 |
<context name="_end_rule_irnc" attribute="Normal Text" lineEndContext="#stay"> |
| 1383 |
<keyword String="profile_head" context="#pop!_profile_name" attribute="Profile Head Error" firstNonSpace="true" endRegion="Rule"/> |
| 1384 |
<keyword String="rule_access_qualifiers" context="#pop" attribute="Rule Access Qualifier Error" firstNonSpace="true" endRegion="Rule"/> |
| 1385 |
<keyword String="rule_qualifiers" context="#pop" attribute="Rule Qualifier Error" firstNonSpace="true" endRegion="Rule"/> |
| 1386 |
<keyword String="file_rule_qualifiers" context="#pop" attribute="File Rule Qualifier Error" firstNonSpace="true" endRegion="Rule"/> |
| 1387 |
<RegExpr String="set(?=\s+rlimit\b)" context="#pop" attribute="Rule Error" firstNonSpace="true" endRegion="Rule"/> |
| 1388 |
|
| 1389 |
<keyword String="rule_name_abi" context="#pop!_rule_abi" attribute="Rule Error" firstNonSpace="true" endRegion="Rule" beginRegion="Rule"/> |
| 1390 |
<keyword String="rule_name_file" context="#pop!_rule_file" attribute="Rule Error" firstNonSpace="true" endRegion="Rule" beginRegion="Rule"/> |
| 1391 |
<keyword String="rule_name_capability" context="#pop!_rule_capability" attribute="Rule Error" firstNonSpace="true" endRegion="Rule" beginRegion="Rule"/> |
| 1392 |
<keyword String="rule_name_network" context="#pop!_rule_network" attribute="Rule Error" firstNonSpace="true" endRegion="Rule" beginRegion="Rule"/> |
| 1393 |
<keyword String="rule_name_pivotroot" context="#pop!_rule_pivotroot" attribute="Rule Error" firstNonSpace="true" endRegion="Rule" beginRegion="Rule"/> |
| 1394 |
<keyword String="rule_name_ptrace" context="#pop!_rule_ptrace" attribute="Rule Error" firstNonSpace="true" endRegion="Rule" beginRegion="Rule"/> |
| 1395 |
<keyword String="rule_name_signal" context="#pop!_rule_signal" attribute="Rule Error" firstNonSpace="true" endRegion="Rule" beginRegion="Rule"/> |
| 1396 |
<keyword String="rule_name_dbus" context="#pop!_rule_dbus" attribute="Rule Error" firstNonSpace="true" endRegion="Rule" beginRegion="Rule"/> |
| 1397 |
<keyword String="rule_name_link" context="#pop!_rule_link" attribute="Rule Error" firstNonSpace="true" endRegion="Rule" beginRegion="Rule"/> |
| 1398 |
<keyword String="rule_name_changeprofile" context="#pop!_rule_changeprofile" attribute="Rule Error" firstNonSpace="true" endRegion="Rule" beginRegion="Rule"/> |
| 1399 |
<keyword String="rule_name_rlimit" context="#pop!_rule_rlimit" attribute="Rule Error" firstNonSpace="true" endRegion="Rule" beginRegion="Rule"/> |
| 1400 |
<!-- This must be at the end of each rule context, to avoid replacing the 'unix' & 'remount' keywords |
| 1401 |
('unix' is also a domain of the network rule; 'remount' is also a flag of the mount rule). --> |
| 1402 |
<keyword String="rule_name_mount" context="#pop!_rule_mount" attribute="Rule Error" firstNonSpace="true" endRegion="Rule" beginRegion="Rule"/> |
| 1403 |
<keyword String="rule_name_unix" context="#pop!_rule_unix" attribute="Rule Error" firstNonSpace="true" endRegion="Rule" beginRegion="Rule"/> |
| 1404 |
<!-- Not included: alias rule --> |
| 1405 |
</context> |
| 1406 |
<!-- For blocks of parentheses within rules (the same keywords as "_end_rule_irnc"!) --> |
| 1407 |
<context name="_end_rule_irnc_parentheses_rule" attribute="Normal Text" lineEndContext="#stay"> |
| 1408 |
<keyword String="profile_head" context="#pop" attribute="Profile Head Error" lookAhead="true" firstNonSpace="true"/> |
| 1409 |
<keyword String="rule_access_qualifiers" context="#pop" attribute="Rule Access Qualifier Error" lookAhead="true" firstNonSpace="true"/> |
| 1410 |
<keyword String="rule_qualifiers" context="#pop" attribute="Rule Qualifier Error" lookAhead="true" firstNonSpace="true"/> |
| 1411 |
<keyword String="file_rule_qualifiers" context="#pop" attribute="File Rule Qualifier Error" lookAhead="true" firstNonSpace="true"/> |
| 1412 |
<RegExpr String="set(?=\s+rlimit\b)" context="#pop" attribute="Rule Error" lookAhead="true" firstNonSpace="true"/> |
| 1413 |
<keyword String="rule_name_abi" context="#pop" attribute="Rule Error" lookAhead="true" firstNonSpace="true"/> |
| 1414 |
<keyword String="rule_name_file" context="#pop" attribute="Rule Error" lookAhead="true" firstNonSpace="true"/> |
| 1415 |
<keyword String="rule_name_capability" context="#pop" attribute="Rule Error" lookAhead="true" firstNonSpace="true"/> |
| 1416 |
<keyword String="rule_name_network" context="#pop" attribute="Rule Error" lookAhead="true" firstNonSpace="true"/> |
| 1417 |
<keyword String="rule_name_pivotroot" context="#pop" attribute="Rule Error" lookAhead="true" firstNonSpace="true"/> |
| 1418 |
<keyword String="rule_name_ptrace" context="#pop" attribute="Rule Error" lookAhead="true" firstNonSpace="true"/> |
| 1419 |
<keyword String="rule_name_signal" context="#pop" attribute="Rule Error" lookAhead="true" firstNonSpace="true"/> |
| 1420 |
<keyword String="rule_name_dbus" context="#pop" attribute="Rule Error" lookAhead="true" firstNonSpace="true"/> |
| 1421 |
<keyword String="rule_name_link" context="#pop" attribute="Rule Error" lookAhead="true" firstNonSpace="true"/> |
| 1422 |
<keyword String="rule_name_changeprofile" context="#pop" attribute="Rule Error" lookAhead="true" firstNonSpace="true"/> |
| 1423 |
<keyword String="rule_name_rlimit" context="#pop" attribute="Rule Error" lookAhead="true" firstNonSpace="true"/> |
| 1424 |
<!-- Keep at the end to avoid conflicts! --> |
| 1425 |
<keyword String="rule_name_mount" context="#pop" attribute="Rule Error" lookAhead="true" firstNonSpace="true"/> |
| 1426 |
<keyword String="rule_name_unix" context="#pop" attribute="Rule Error" lookAhead="true" firstNonSpace="true"/> |
| 1427 |
<!-- Not included: alias rule --> |
| 1428 |
</context> |
| 1429 |
|
| 1430 |
<!-- Paths & File Globals --> |
| 1431 |
|
| 1432 |
<context name="_find_path" attribute="Normal Text" lineEndContext="#stay"> |
| 1433 |
<DetectChar context="_path_content" attribute="Path" char="/" lookAhead="true"/> |
| 1434 |
<RegExpr context="_path_content" String=":(?:[^\:&noPathChar;\(\\]|\\.)+:" lookAhead="true"/> <!-- :namespace: --> |
| 1435 |
</context> |
| 1436 |
<context name="_path_content" attribute="Path" lineEndContext="#pop"> |
| 1437 |
<RegExpr context="#pop" String="&endPath;" lookAhead="true"/> |
| 1438 |
<IncludeRules context="_default_path"/> |
| 1439 |
<Detect2Chars context="_hat_path" char="/" char1="/" lookAhead="true"/> |
| 1440 |
</context> |
| 1441 |
<context name="_parentheses_path_content" attribute="Path" lineEndContext="#pop"> |
| 1442 |
<DetectChar context="#pop" char="," lookAhead="true"/> |
| 1443 |
<IncludeRules context="_default_path"/> |
| 1444 |
<Detect2Chars context="_hat_path_parentheses" char="/" char1="/" lookAhead="true"/> |
| 1445 |
</context> |
| 1446 |
<context name="_default_path" attribute="Path" lineEndContext="#pop"> |
| 1447 |
<DetectSpaces context="#pop" lookAhead="true"/> |
| 1448 |
<AnyChar context="#pop" String="&noPathCharWithoutSpace;" lookAhead="true"/> |
| 1449 |
<IncludeRules context="_variable_simple"/> |
| 1450 |
<IncludeRules context="_path_globbing"/> |
| 1451 |
</context> |
| 1452 |
|
| 1453 |
<!-- Globbing --> |
| 1454 |
<context name="_path_globbing" attribute="Normal Text" lineEndContext="#stay"> |
| 1455 |
<IncludeRules context="_brackets_error"/> |
| 1456 |
<DetectChar context="_curly_brackets" attribute="Globbing Brackets" char="{"/> |
| 1457 |
<DetectChar context="_square_brackets" attribute="Globbing Brackets" char="["/> |
| 1458 |
<DetectChar context="_round_brackets" attribute="Globbing Brackets" char="("/> |
| 1459 |
<IncludeRules context="_path_globbing_chars"/> |
| 1460 |
</context> |
| 1461 |
<context name="_path_globbing_chars" attribute="Normal Text" lineEndContext="#stay"> |
| 1462 |
<AnyChar context="#stay" attribute="Globbing Char" String="&globbChars;"/> |
| 1463 |
<IncludeRules context="_escape"/> |
| 1464 |
</context> |
| 1465 |
<!-- Escapes: Hexadecimal (\xNN), decimal (\dNNN) & octal (\NNN). Also make literal any character. |
| 1466 |
NOTE: Reserved character escape sequences: \\"aefnrt0 --> |
| 1467 |
<context name="_escape" attribute="Normal Text" lineEndContext="#stay"> |
| 1468 |
<RegExpr context="#stay" attribute="Escape Char" String="\\(?:x[a-fA-F\d]{1,2}|d\d{1,3}|[0-3][0-7]{0,2}|[4-7][0-7]?|.)"/> |
| 1469 |
</context> |
| 1470 |
<context name="_profile_transition_escape" attribute="Transition Profile Name" lineEndContext="#stay"> |
| 1471 |
<RegExpr context="#stay" attribute="Globbing Char in Tran. Prof." String="\\(?:x[a-fA-F\d]{1,2}|d\d{1,3}|[0-3][0-7]{0,2}|[4-7][0-7]?|.)"/> |
| 1472 |
</context> |
| 1473 |
|
| 1474 |
<!-- Groups of brackets: { }, [ ] and ( ) --> |
| 1475 |
<context name="_curly_brackets" attribute="Globbing Brackets" lineEndContext="#pop"> |
| 1476 |
<DetectChar context="#pop" attribute="Globbing Brackets" char="}"/> |
| 1477 |
<RegExpr context="#stay" attribute="Open Globbing Brackets" String="[^&noPathChar;\(\[\{\}\\](?=[&noPathChar;]|$)"/> |
| 1478 |
<IncludeRules context="_default_path"/> |
| 1479 |
<IncludeRules context="_default_curly_brackets"/> |
| 1480 |
</context> |
| 1481 |
<context name="_square_brackets" attribute="Globbing Brackets" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop!_square_brackets_content"> |
| 1482 |
<RegExpr context="#pop!_square_brackets_content" attribute="Globbing Char of Brackets" String="\^(?=[^\s\]"])"/> |
| 1483 |
</context> |
| 1484 |
<context name="_square_brackets_content" attribute="Globbing Brackets" lineEndContext="#pop"> |
| 1485 |
<DetectChar context="#pop" attribute="Globbing Brackets" char="]"/> |
| 1486 |
<DetectSpaces context="#pop" lookAhead="true"/> |
| 1487 |
<DetectChar context="#pop" char=""" lookAhead="true"/> <!-- &noPathChar; --> |
| 1488 |
<RegExpr context="#stay" attribute="Open Globbing Brackets" String="[^\s\[\]\\](?=["\s]|$)"/> <!-- &noPathChar; --> |
| 1489 |
<IncludeRules context="_default_square_brackets"/> |
| 1490 |
</context> |
| 1491 |
<context name="_round_brackets" attribute="Globbing Brackets" lineEndContext="#pop"> |
| 1492 |
<DetectChar context="#pop" attribute="Globbing Brackets" char=")"/> |
| 1493 |
<RegExpr context="#stay" attribute="Open Globbing Brackets" String="[^&noPathChar;\(\[\{\\](?=["\s]|$)"/> <!-- &noPathChar; --> |
| 1494 |
<IncludeRules context="_default_path"/> |
| 1495 |
<IncludeRules context="_default_round_brackets"/> |
| 1496 |
</context> |
| 1497 |
|
| 1498 |
<!-- Brackets quoted (allow spaces and line breaks) --> |
| 1499 |
<context name="_curly_brackets_quoted" attribute="Globbing Brackets" lineEndContext="#stay"> |
| 1500 |
<DetectChar context="#pop" attribute="Globbing Brackets" char="}"/> |
| 1501 |
<DetectChar context="#pop" char=""" lookAhead="true"/> |
| 1502 |
<RegExpr context="#stay" attribute="Open Globbing Brackets" String="[^\s"\(\[\{\}\\](?=\s*")"/> |
| 1503 |
<IncludeRules context="_default_quoted"/> |
| 1504 |
<IncludeRules context="_default_curly_brackets"/> |
| 1505 |
</context> |
| 1506 |
<context name="_square_brackets_quoted" attribute="Globbing Brackets" lineEndContext="#pop!_square_brackets_content_quoted" fallthrough="true" fallthroughContext="#pop!_square_brackets_content_quoted"> |
| 1507 |
<RegExpr context="#pop!_square_brackets_content_quoted" attribute="Globbing Char of Brackets" String="\^(?=[^\]"])"/> |
| 1508 |
</context> |
| 1509 |
<context name="_square_brackets_content_quoted" attribute="Globbing Brackets" lineEndContext="#stay"> |
| 1510 |
<DetectChar context="#pop" attribute="Globbing Brackets" char="]"/> |
| 1511 |
<DetectChar context="#pop" char=""" lookAhead="true"/> |
| 1512 |
<RegExpr context="#stay" attribute="Open Globbing Brackets" String="[^\s"\[\]\\](?=\s*")"/> |
| 1513 |
<IncludeRules context="_default_square_brackets"/> |
| 1514 |
</context> |
| 1515 |
<context name="_round_brackets_quoted" attribute="Globbing Brackets" lineEndContext="#stay"> |
| 1516 |
<DetectChar context="#pop" attribute="Globbing Brackets" char=")"/> |
| 1517 |
<DetectChar context="#pop" char=""" lookAhead="true"/> |
| 1518 |
<RegExpr context="#stay" attribute="Open Globbing Brackets" String="[^\s"\[\{\(\)\\](?=\s*")"/> |
| 1519 |
<IncludeRules context="_default_quoted"/> |
| 1520 |
<IncludeRules context="_default_round_brackets"/> |
| 1521 |
</context> |
| 1522 |
|
| 1523 |
<context name="_default_curly_brackets" attribute="Globbing Brackets" lineEndContext="#stay"> |
| 1524 |
<DetectChar context="#stay" attribute="Globbing Char of Brackets" char=","/> |
| 1525 |
<keyword context="#stay" String="default_variables"/> |
| 1526 |
</context> |
| 1527 |
<context name="_default_round_brackets" attribute="Globbing Brackets" lineEndContext="#stay"> |
| 1528 |
<DetectChar context="#stay" attribute="Globbing Char of Brackets" char="|"/> |
| 1529 |
</context> |
| 1530 |
<context name="_default_square_brackets" attribute="Globbing Brackets" lineEndContext="#stay"> |
| 1531 |
<IncludeRules context="_variable_simple"/> |
| 1532 |
<DetectChar context="#stay" attribute="Error" char="["/> |
| 1533 |
<IncludeRules context="_path_globbing_chars"/> |
| 1534 |
</context> |
| 1535 |
<context name="_brackets_error" attribute="Normal Text" lineEndContext="#stay"> |
| 1536 |
<Detect2Chars context="#stay" attribute="Error" char="[" char1="]"/> |
| 1537 |
<Detect2Chars context="#stay" attribute="Error" char="{" char1="}"/> |
| 1538 |
<Detect2Chars context="#stay" attribute="Error" char="(" char1=")"/> |
| 1539 |
</context> |
| 1540 |
|
| 1541 |
<!-- If the brackets are outside a path --> |
| 1542 |
<context name="_r_curly_brackets" attribute="Globbing Brackets" lineEndContext="#pop"> |
| 1543 |
<DetectChar context="#pop!_find_path_after_variable" attribute="Globbing Brackets" char="}"/> |
| 1544 |
<IncludeRules context="_curly_brackets"/> |
| 1545 |
</context> |
| 1546 |
<context name="_r_square_brackets" attribute="Globbing Brackets" lineEndContext="#pop"> |
| 1547 |
<DetectChar context="#pop!_find_path_after_variable" attribute="Globbing Brackets" char="]"/> |
| 1548 |
<IncludeRules context="_square_brackets"/> |
| 1549 |
</context> |
| 1550 |
<!-- In block of parentheses... --> |
| 1551 |
<context name="_p_curly_brackets" attribute="Globbing Brackets" lineEndContext="#pop"> |
| 1552 |
<DetectChar context="#pop!_parentheses_find_path_after_variable" attribute="Globbing Brackets" char="}"/> |
| 1553 |
<IncludeRules context="_curly_brackets"/> |
| 1554 |
</context> |
| 1555 |
<context name="_p_square_brackets" attribute="Globbing Brackets" lineEndContext="#pop"> |
| 1556 |
<DetectChar context="#pop!_parentheses_find_path_after_variable" attribute="Globbing Brackets" char="]"/> |
| 1557 |
<IncludeRules context="_square_brackets"/> |
| 1558 |
</context> |
| 1559 |
|
| 1560 |
<!-- Path Quoted --> |
| 1561 |
<context name="_find_text_quoted" attribute="Normal Text" lineEndContext="#stay"> |
| 1562 |
<DetectChar context="_quoted" attribute="Text Quoted" char="""/> |
| 1563 |
</context> |
| 1564 |
<context name="_quoted" attribute="Text Quoted" lineEndContext="#stay"> |
| 1565 |
<DetectChar context="#pop" attribute="Text Quoted" char="""/> |
| 1566 |
<IncludeRules context="_default_quoted"/> |
| 1567 |
<Detect2Chars context="_hat_path_quoted" char="/" char1="/" lookAhead="true"/> |
| 1568 |
</context> |
| 1569 |
<context name="_default_quoted" attribute="Text Quoted" lineEndContext="#stay"> |
| 1570 |
<IncludeRules context="_variable_simple"/> |
| 1571 |
<IncludeRules context="_brackets_error"/> |
| 1572 |
<DetectChar context="_curly_brackets_quoted" attribute="Globbing Brackets" char="{"/> |
| 1573 |
<DetectChar context="_square_brackets_quoted" attribute="Globbing Brackets" char="["/> |
| 1574 |
<DetectChar context="_round_brackets_quoted" attribute="Globbing Brackets" char="("/> |
| 1575 |
<IncludeRules context="_path_globbing_chars"/> |
| 1576 |
</context> |
| 1577 |
|
| 1578 |
</contexts> |
| 1579 |
|
| 1580 |
<itemDatas> |
| 1581 |
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/> |
| 1582 |
<itemData name="Path" defStyleNum="dsNormal" spellChecking="false"/> |
| 1583 |
<itemData name="Text Quoted" defStyleNum="dsString" spellChecking="false"/> |
| 1584 |
<itemData name="Comment" defStyleNum="dsComment"/> |
| 1585 |
<itemData name="URL in Comment" defStyleNum="dsComment" underline="1" spellChecking="false"/> |
| 1586 |
<itemData name="Preprocessor" defStyleNum="dsPreprocessor" spellChecking="false"/> |
| 1587 |
<itemData name="Prep. Lib" defStyleNum="dsImport" underline="0" spellChecking="false"/> |
| 1588 |
<itemData name="Open Prep. Lib" defStyleNum="dsImport" underline="1" spellChecking="false"/> |
| 1589 |
<itemData name="Variable" defStyleNum="dsBaseN" bold="0" spellChecking="false"/> |
| 1590 |
|
| 1591 |
<itemData name="Profile Head" defStyleNum="dsFunction" bold="1" underline="0" spellChecking="false"/> |
| 1592 |
<itemData name="Profile Name" defStyleNum="dsFunction" bold="0" underline="0" spellChecking="false"/> |
| 1593 |
<itemData name="Rule Qualifier" defStyleNum="dsKeyword" bold="1" underline="0" spellChecking="false"/> |
| 1594 |
<itemData name="Rule Access Qualifier" defStyleNum="dsWarning" bold="1" underline="0" italic="0" spellChecking="false"/> |
| 1595 |
<itemData name="File Rule Qualifier" defStyleNum="dsVariable" bold="1" underline="0" italic="0" spellChecking="false"/> |
| 1596 |
<itemData name="Rule" defStyleNum="dsVariable" bold="1" underline="0" italic="0" spellChecking="false"/> |
| 1597 |
<itemData name="Data" defStyleNum="dsVariable" bold="0" underline="0" italic="0" spellChecking="false"/> |
| 1598 |
<itemData name="Other Data" defStyleNum="dsNormal" italic="1" spellChecking="false"/> |
| 1599 |
<itemData name="Permissions" defStyleNum="dsNormal" bold="1" spellChecking="false"/> |
| 1600 |
|
| 1601 |
<itemData name="Option" defStyleNum="dsOthers" spellChecking="false"/> |
| 1602 |
<itemData name="Other Option" defStyleNum="dsAttribute" spellChecking="false"/> |
| 1603 |
<itemData name="Flags" defStyleNum="dsVerbatimString" spellChecking="false"/> |
| 1604 |
<itemData name="SubProfile/Hat" defStyleNum="dsAnnotation" bold="0" underline="0" italic="0" spellChecking="false"/> |
| 1605 |
<itemData name="SubProfile/Hat Operator" defStyleNum="dsAnnotation" bold="1" underline="0" italic="0" spellChecking="false"/> |
| 1606 |
<itemData name="Operator 1" defStyleNum="dsOperator" spellChecking="false"/> |
| 1607 |
<itemData name="Operator 2" defStyleNum="dsWarning" bold="1" underline="0" italic="0" spellChecking="false"/> |
| 1608 |
<itemData name="Number" defStyleNum="dsDecVal" spellChecking="false"/> |
| 1609 |
<itemData name="Numerical Unit" defStyleNum="dsDecVal" bold="1" spellChecking="false"/> |
| 1610 |
<itemData name="End of Rule Char" defStyleNum="dsNormal" spellChecking="false"/> |
| 1611 |
|
| 1612 |
<itemData name="Escape Char" defStyleNum="dsSpecialChar" spellChecking="false"/> |
| 1613 |
<itemData name="Globbing Char" defStyleNum="dsSpecialChar" spellChecking="false"/> |
| 1614 |
<itemData name="Globbing Char of Brackets" defStyleNum="dsBuiltIn" bold="0" underline="0" italic="0" spellChecking="false"/> |
| 1615 |
<itemData name="Globbing Brackets" defStyleNum="dsVerbatimString" underline="0" spellChecking="false"/> |
| 1616 |
<itemData name="Open Globbing Brackets" defStyleNum="dsVerbatimString" underline="1" spellChecking="false"/> |
| 1617 |
|
| 1618 |
<itemData name="Transition Profile Name" defStyleNum="dsFunction" bold="0" italic="1" underline="0" spellChecking="false"/> |
| 1619 |
<itemData name="Globbing Char in Tran. Prof." defStyleNum="dsSpecialChar" bold="0" italic="1" underline="0" spellChecking="false"/> |
| 1620 |
<itemData name="Hat Operator in Tran. Prof." defStyleNum="dsAnnotation" bold="1" italic="1" underline="0" spellChecking="false"/> |
| 1621 |
|
| 1622 |
<itemData name="Rule Error" defStyleNum="dsVariable" bold="1" underline="1" italic="0" spellChecking="false"/> |
| 1623 |
<itemData name="Rule Qualifier Error" defStyleNum="dsKeyword" bold="1" underline="1" spellChecking="false"/> |
| 1624 |
<itemData name="Rule Access Qualifier Error" defStyleNum="dsWarning" bold="1" underline="1" italic="0" spellChecking="false"/> |
| 1625 |
<itemData name="File Rule Qualifier Error" defStyleNum="dsVariable" bold="1" underline="1" italic="0" spellChecking="false"/> |
| 1626 |
<itemData name="Profile Head Error" defStyleNum="dsFunction" bold="1" underline="1" spellChecking="false"/> |
| 1627 |
<itemData name="Profile Name Error" defStyleNum="dsFunction" bold="0" underline="1" spellChecking="false"/> |
| 1628 |
<itemData name="Error" defStyleNum="dsError" spellChecking="false"/> |
| 1629 |
</itemDatas> |
| 1630 |
|
| 1631 |
</highlighting> |
| 1632 |
|
| 1633 |
<general> |
| 1634 |
<!-- Keyword delimiters: .()<>=/\[]{},"'^;:| --> |
| 1635 |
<keywords casesensitive="true" additionalDeliminator=""'" weakDeliminator="!+-%*?~&"/> |
| 1636 |
|
| 1637 |
<comments> |
| 1638 |
<comment name="singleLine" start="#"/> |
| 1639 |
</comments> |
| 1640 |
</general> |
| 1641 |
|
| 1642 |
</language> |
| 1643 |
<!-- kate: replace-tabs off; tab-width 3; indent-width 3; remove-trailing-spaces mod; dynamic-word-wrap off; --> |