libselinux: android: allow dup *_context entries

Similar to upstream commit 742a350d "libsepol/cil: Improve processing
of context rules", allow multiple-same mappings, but make this the
default for android-specific *_contexts files. Continue to print a
warning. This is useful for Treble where some device-specific
mappings may be moved to core policy. e.g.
https://android-review.googlesource.com/c/platform/system/sepolicy/+/663068.
Old vendor images must continue to work with new system images even
when they contain the same mapping.

Bug: 78134108
Test: Verify multiple same mappings load correctly, and multiple
different specs continue to fail.

Change-Id: I80e81814b7ce213489a7820a12be3fb297150e7d
(cherry picked from commit 5f6217efcfa3e84a9bb65351516d0b0a574b8cc0)
1 file changed