summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Bellavance <flintman@flintmancomputers.com>2016-08-30 08:04:38 -0400
committeralk3pInjection <webmaster@raspii.tech>2022-01-11 21:20:40 +0800
commitb886c7e1963cd92cbb6168f9ee1ecf1d4f2abd78 (patch)
tree85cfb093375cabc866301d1ed500bf4c77d0fdbe
parentddc681b5b8af05de0ce424773e31db5fe44ff4c1 (diff)
init: don't skip starting a service with no domain if permissive
[Adrian DC] Preserve the log while permissive Change-Id: I3f2887930e15d09014c2594141ba4acbbc8d6d9d
-rw-r--r--init/service.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/init/service.cpp b/init/service.cpp
index c3069f5b2..dcb3d0c3c 100644
--- a/init/service.cpp
+++ b/init/service.cpp
@@ -88,13 +88,16 @@ static Result<std::string> ComputeContextFromExecutable(const std::string& servi
free(new_con);
}
if (rc == 0 && computed_context == mycon.get()) {
- return Error() << "File " << service_path << "(labeled \"" << filecon.get()
- << "\") has incorrect label or no domain transition from " << mycon.get()
- << " to another SELinux domain defined. Have you configured your "
- "service correctly? https://source.android.com/security/selinux/"
- "device-policy#label_new_services_and_address_denials. Note: this "
- "error shows up even in permissive mode in order to make auditing "
- "denials possible.";
+ std::string error = StringPrintf(
+ "File %s (labeled \"%s\") has incorrect label or no domain transition from %s to "
+ "another SELinux domain defined. Have you configured your "
+ "service correctly? https://source.android.com/security/selinux/"
+ "device-policy#label_new_services_and_address_denials",
+ service_path.c_str(), filecon.get(), mycon.get());
+ if (security_getenforce() != 0) {
+ return Error() << error;
+ }
+ LOG(ERROR) << error;
}
if (rc < 0) {
return Error() << "Could not get process context";