libsepol: fix pp module to cil nodecon statement
PATCH 1/1 libsepol: fix pp module to cil nodecon statement
Policy modules do not have the concept of named IP addresses like CIL does. So when converting nodecode statements from pp policy modules to CIL, we need to wrap the IP address and mask parameters in parentheses so that the CIL compiler does not try to resolve them as named addresses, but instead treats them as anonymous.
Signed-off-by Steve Lawrence <[email protected]>
--- libsepol/src/module_to_cil.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
libsepol/src/module_to_cil.c +2 -2
@@ -2721,7 +2721,7 @@ static int ocontext_selinux_node_to_cil(struct policydb *pdb, struct ocontext *n goto exit; } -cil_printf ("(nodecon %s %s " , addr, mask); +cil_printf ("(nodecon (%s) (%s) " , addr, mask);context_to_cil (pdb, &node->context[0 ]);
@@ -2753,7 +2753,7 @@ static int ocontext_selinux_node6_to_cil(struct policydb *pdb, struct ocontext * goto exit; } -cil_printf ("(nodecon %s %s " , addr, mask); +cil_printf ("(nodecon (%s) (%s) " , addr, mask);context_to_cil (pdb, &node->context[0 ]);
Signature · 1 line
2.7.4
James Carter
AppliedQuoted 7 lines · Steve Lawrence
Policy modules do not have the concept of named IP addresses like CIL does. So when converting nodecode statements from pp policy modules to CIL, we need to wrap the IP address and mask parameters in parentheses so that the CIL compiler does not try to resolve them as named addresses, but instead treats them as anonymous.
Signed-off-by Steve Lawrence <[email protected]>
Applied,
Thanks,
Jim
Quoted 27 lines
--- libsepol/src/module_to_cil.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)libsepol/src/module_to_cil.c +2
-2@@ -2721,7 +2721,7 @@ static int ocontext_selinux_node_to_cil(struct policydb *pdb, struct ocontext *n goto exit; } -cil_printf ("(nodecon %s %s " , addr, mask); +cil_printf ("(nodecon (%s) (%s) " , addr, mask);context_to_cil (pdb, &node->context[0 ]);@@ -2753,7 +2753,7 @@ static int ocontext_selinux_node6_to_cil(struct policydb *pdb, struct ocontext * goto exit; } -cil_printf ("(nodecon %s %s " , addr, mask); +cil_printf ("(nodecon (%s) (%s) " , addr, mask);context_to_cil (pdb, &node->context[0 ]);
Signature · 2 lines
James Carter <[email protected]> National Security Agency