summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tri Vo <trong@google.com> 2019-10-04 12:34:53 -0700
committer Tri Vo <trong@google.com> 2019-10-04 12:48:33 -0700
commit6ea2698df4fd9247994d5a1c04c9d5940da2ff79 (patch)
tree29ceaad770ad4c2ac1472ed3d7f57c6cc806d8f5
parent56701ba87948fcab7bccf771ac39e7778f763b0a (diff)
servicemanager: lookup service labels using "service" backend
Type 0 actually corresponds file_contexts backend. Use type SELABEL_CTX_ANDROID_SERVICE instead. https://android.googlesource.com/platform/external/libselinux/+/d4828b3ba449355aa2d1751026e5f1d1129cedcf/include/selinux/label.h#27 Test: boot cuttlefish; no denials to any service Change-Id: I1c33c31ecbd46168998606c3463837a9c6f39f3a
-rw-r--r--cmds/servicemanager/Access.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmds/servicemanager/Access.cpp b/cmds/servicemanager/Access.cpp
index 606477fee7..b7e520f2f1 100644
--- a/cmds/servicemanager/Access.cpp
+++ b/cmds/servicemanager/Access.cpp
@@ -137,7 +137,7 @@ bool Access::actionAllowed(const CallingContext& sctx, const char* tctx, const c
bool Access::actionAllowedFromLookup(const CallingContext& sctx, const std::string& name, const char *perm) {
char *tctx = nullptr;
- if (selabel_lookup(getSehandle(), &tctx, name.c_str(), 0) != 0) {
+ if (selabel_lookup(getSehandle(), &tctx, name.c_str(), SELABEL_CTX_ANDROID_SERVICE) != 0) {
LOG(ERROR) << "SELinux: No match for " << name << " in service_contexts.\n";
return false;
}