diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-03-04 22:08:32 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-03-04 22:08:32 +0000 |
commit | 52477ab805ef3f5ffb27d75105292f96cdc85166 (patch) | |
tree | c62fbe5f81aa1d2f053caaf999b4ff98e9a2a50c | |
parent | c7863240e44f5612ab46ddcc70301052f7f631b8 (diff) | |
parent | 2273a74d0049f8fa95185882e3b928ceddd77764 (diff) | |
download | selinux-simpleperf-release.tar.gz |
Snap for 11526323 from 2273a74d0049f8fa95185882e3b928ceddd77764 to simpleperf-releasesimpleperf-release
Change-Id: I25e83f8a761b4816ba2ba5f7ade51e48e5accce1
-rw-r--r-- | libselinux/Android.bp | 12 | ||||
-rw-r--r-- | libselinux/utils/selabel_get_digests_all_partial_matches.c | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/libselinux/Android.bp b/libselinux/Android.bp index ff7dc3d3..766c90ed 100644 --- a/libselinux/Android.bp +++ b/libselinux/Android.bp @@ -222,6 +222,18 @@ cc_binary_host { stl: "", } +cc_binary { + name: "selabel_get_digests_all_partial_matches", + defaults: ["libselinux_defaults"], + srcs: ["utils/selabel_get_digests_all_partial_matches.c"], + + static_libs: [ + "libselinux", + ], + + stl: "", +} + rust_bindgen { name: "libselinux_bindgen", wrapper_src: "rust/selinux.h", diff --git a/libselinux/utils/selabel_get_digests_all_partial_matches.c b/libselinux/utils/selabel_get_digests_all_partial_matches.c index c4e0f836..fc518439 100644 --- a/libselinux/utils/selabel_get_digests_all_partial_matches.c +++ b/libselinux/utils/selabel_get_digests_all_partial_matches.c @@ -5,6 +5,7 @@ #include <errno.h> #include <stdbool.h> #include <fts.h> +#include <selinux/android.h> #include <selinux/selinux.h> #include <selinux/label.h> @@ -71,10 +72,14 @@ int main(int argc, char **argv) paths[0] = argv[optind]; +#ifdef ANDROID + hnd = selinux_android_file_context_handle(); +#else selabel_option[0].value = file; selabel_option[1].value = validate; hnd = selabel_open(SELABEL_CTX_FILE, selabel_option, 2); +#endif if (!hnd) { fprintf(stderr, "ERROR: selabel_open - Could not obtain " "handle: %s\n", |