Skip to content

Commit

Permalink
Support "." as a valid character in STRINGs, so that paths containing
Browse files Browse the repository at this point in the history
"." will be supported
  • Loading branch information
dburgener committed Jul 12, 2023
1 parent 17347c4 commit bb13f39
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lex.l
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ template { return TEMPLATE; }
userdebug_or_eng { return USERDEBUG_OR_ENG; }
[0-9]+\.[0-9]+(\.[0-9]+)? { yylval->string = xstrdup(yytext); return VERSION_NO; }
[0-9]+ { yylval->string = xstrdup(yytext); return NUMBER; }
[a-zA-Z\$\/][a-zA-Z0-9_\$\*\/\-]* { yylval->string = xstrdup(yytext); return STRING; }
[a-zA-Z\$\/][a-zA-Z0-9_\$\*\/\-\.]* { yylval->string = xstrdup(yytext); return STRING; }
[0-9a-zA-Z\$\/][a-zA-Z0-9_\$\*\/\-]* { yylval->string = xstrdup(yytext); return NUM_STRING; }
[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3} { yylval->string = xstrdup(yytext); return IPV4; }
([0-9A-Fa-f]{1,4})?\:([0-9A-Fa-f\:])*\:([0-9A-Fa-f]{1,4})?(\:[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})? { yylval->string = xstrdup(yytext); return IPV6; }
Expand Down
1 change: 1 addition & 0 deletions tests/sample_policy_files/uncommon.te
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ portcon udp 7007 gen_context(system_u:object_r:afs_bos_port_t,s0,s1:c0.c225)
portcon udp 7007-7008 gen_context(system_u:object_r:afs_bos_port_t,s0)
fs_use_trans devtmpfs gen_context(system_u:object_r:device_t,s0);
genfscon sysfs /devices/system/cpu/online gen_context(system_u:object_r:cpu_online_t,s0)
genfscon sysfs /dev/ice/platform/contains.dot/1-1 gen_context(system_u:object_r:label_t,s0)
genfscon cgroup "/system.slice" -d gen_context(system_u:object_r:cgroup_system_slice_t,s0)
fs_use_xattr btrfs gen_context(system_u:object_r:fs_t,s0);
fs_use_task eventpollfs gen_context(system_u:object_r:fs_t,s0);
Expand Down

0 comments on commit bb13f39

Please sign in to comment.