0d6864aebd
Previous behaviour: Test: Set `PRODUCT_PUBLIC_SEPOLICY_DIRS`, causing `product_sepolicy.cil` and `product_mapping_file` to be generated. Do not use any `type` declarations that would require a mapping in product sepolicy, e.g. only define macros. Run `make selinux_policy`, observe error: ``` FAILED: out/target/product/mydevice/obj/ETC/plat_pub_versioned.cil_intermediates/plat_pub_versioned.cil /bin/bash -c "(out/host/linux-x86/bin/version_policy -b out/target/product/mydevice/obj/FAKE/sepolicy_neverallows_intermediates/pub_policy.cil -t out/target/product/mydevice/obj/FAKE/sepolicy_neverallows_intermediates/pub_policy.cil -n 10000.0 -o out/target/product/mydevice/obj/ETC/plat_pub_versioned.cil_intermediates/plat_pub_versioned.cil ) && (out/host/linux-x86/bin/secilc -m -M true -G -N -c 30 out/target/product/mydevice/obj/ETC/plat_sepolicy.cil_intermediates/plat_sepolicy.cil out/target/product/mydevice/obj/ETC/product_sepolicy.cil_intermediates/product_sepolicy.cil out/target/product/mydevice/obj/ETC/plat_mapping_file_intermediates/10000.0.cil out/target/product/mydevice/obj/ETC/product_mapping_file_intermediates/10000.0.cil out/target/product/mydevice/obj/ETC/plat_pub_versioned.cil_intermediates/plat_pub_versioned.cil -o /dev/null -f /dev/null )" Failure reading file: out/target/product/mydevice/obj/ETC/product_mapping_file_intermediates/10000.0.cil ``` This is caused by `secilc.c` trying to read the empty file: ``` rc = fread(buffer, file_size, 1, file); ``` Fix: Append a newline to make sure any file processed by `filter_out` is still readable by secilc. After: Test: `make selinux_policy` with same preconditions. Signed-off-by: Felix <google@ix5.org> Change-Id: I6dcfcccdfa83121bbdc09632f7a2b609ef932fc9 |
||
---|---|---|
.. | ||
soong | ||
Android.bp | ||
build_sepolicy.py | ||
file_utils.py |