Merge "Add selabel_get_digests_all_partial_matches binary" into main am: 2273a74d00
Original change: https://android-review.googlesource.com/c/platform/external/selinux/+/2981571 Change-Id: Icc0c501c6a3841b4bede6bdf2821c3627d6cb67e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
b39171460b
2 changed files with 17 additions and 0 deletions
|
@ -222,6 +222,18 @@ cc_binary_host {
|
||||||
stl: "",
|
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 {
|
rust_bindgen {
|
||||||
name: "libselinux_bindgen",
|
name: "libselinux_bindgen",
|
||||||
wrapper_src: "rust/selinux.h",
|
wrapper_src: "rust/selinux.h",
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <fts.h>
|
#include <fts.h>
|
||||||
|
#include <selinux/android.h>
|
||||||
#include <selinux/selinux.h>
|
#include <selinux/selinux.h>
|
||||||
#include <selinux/label.h>
|
#include <selinux/label.h>
|
||||||
|
|
||||||
|
@ -71,10 +72,14 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
paths[0] = argv[optind];
|
paths[0] = argv[optind];
|
||||||
|
|
||||||
|
#ifdef ANDROID
|
||||||
|
hnd = selinux_android_file_context_handle();
|
||||||
|
#else
|
||||||
selabel_option[0].value = file;
|
selabel_option[0].value = file;
|
||||||
selabel_option[1].value = validate;
|
selabel_option[1].value = validate;
|
||||||
|
|
||||||
hnd = selabel_open(SELABEL_CTX_FILE, selabel_option, 2);
|
hnd = selabel_open(SELABEL_CTX_FILE, selabel_option, 2);
|
||||||
|
#endif
|
||||||
if (!hnd) {
|
if (!hnd) {
|
||||||
fprintf(stderr, "ERROR: selabel_open - Could not obtain "
|
fprintf(stderr, "ERROR: selabel_open - Could not obtain "
|
||||||
"handle: %s\n",
|
"handle: %s\n",
|
||||||
|
|
Loading…
Reference in a new issue