selinux/libsepol
James Carter 9e1a8ee3e5 libsepol/cil: Refactor Named Type Transition Filename Creation
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>
2023-11-21 08:55:54 -05:00
..
cil libsepol/cil: Refactor Named Type Transition Filename Creation 2023-11-21 08:55:54 -05:00
fuzz libsepol/fuzz: more strict fuzzing of binary policies 2023-07-12 13:01:15 -04:00
include libsepol: Changes to ebitmap.h to fix compiler warnings 2023-08-16 13:33:48 -04:00
man Do not automatically install Russian translations 2023-08-16 13:33:47 -04:00
src libsepol: use DJB2a string hash function 2023-11-21 08:55:39 -05:00
tests libsepol/tests: Update the order of neverallow test results 2023-11-21 08:55:45 -05:00
utils libsepol/utils: improve wording 2022-07-06 15:57:24 -04:00
.gitignore libsepol: add policy utilities 2022-04-12 13:09:19 -04:00
LICENSE docs: provide a top level LICENSE file 2022-10-05 08:20:38 -04:00
Makefile
VERSION Update VERSIONs to 3.6-rc1 for release. 2023-11-08 12:51:35 +01:00