mirror of
https://github.com/SELinuxProject/selinux
synced 2025-03-08 19:28:04 +00:00
To support passing a filename as an argument in a macro call that is to be used in a named type transition, the filename is considered to be declared when it is used in a named type transition or passed as an argument with the name flavor. In the struct for a named type transition, there are fields for a pointer to the filename string and the filename datum pointer. When writing out the filename after the resolve phase AST, it is not possible to determine whether the filename in a named type transition is an argument name or an actual filename. If it is an actual filename, then it should be enclosed in double quotes, otherwise, it should not. Currently, it is always double quoted. Rework how filenames are declared and handled, so that if the datum pointer for the name is not NULL, then that is an actual filename that should be double quoted. Otherwise, the value pointed to by the string pointer is used and not double quoted. Move the declaration of the filename to the build phase. Any named type transition that is not in a macro or is not using a macro argument is an actual filename, so create a datum and store that in the struct for the named type transition. Otherwise, store the string in the named type transition. During the resolve phase, filename strings can be looked up to find the actual filename that is being passed into the macro call. Since the name parameter was never used, just get rid of the cil_name struct and use datums directly. Allow either "name" or "string" to be used as the parameter flavor. Internally, it will be a CIL_DECLARED_STRING and "string" will be used to write out the AST. Signed-off-by: James Carter <jwcart2@gmail.com> |
||
---|---|---|
.. | ||
cil | ||
fuzz | ||
include | ||
man | ||
src | ||
tests | ||
utils | ||
.gitignore | ||
LICENSE | ||
Makefile | ||
VERSION |