diff options
author | William Bellavance <flintman@flintmancomputers.com> | 2016-08-30 08:04:38 -0400 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2019-12-11 23:51:45 +0200 |
commit | 7fcf269bea3f804556eff82cb58dd9bdca88e7ad (patch) | |
tree | 9f3b5216c733df9c0005c47cf6ac032e884e251a /init/service.cpp | |
parent | b7bca4c464e5b18187084ea1ccd60ef6129d125c (diff) | |
download | system_core-7fcf269bea3f804556eff82cb58dd9bdca88e7ad.tar.gz system_core-7fcf269bea3f804556eff82cb58dd9bdca88e7ad.tar.bz2 system_core-7fcf269bea3f804556eff82cb58dd9bdca88e7ad.zip |
init: don't skip starting a service with no domain if permissive
Requires external/libselinux change as well
[Adrian DC] Preserve the log while permissive
Change-Id: I3f2887930e15d09014c2594141ba4acbbc8d6d9d
Diffstat (limited to 'init/service.cpp')
-rw-r--r-- | init/service.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/init/service.cpp b/init/service.cpp index ccc37b70c..ad9a3e0af 100644 --- a/init/service.cpp +++ b/init/service.cpp @@ -94,11 +94,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"; + 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 (selinux_status_getenforce() > 0) { + return Error() << error; + } + LOG(ERROR) << error; } if (rc < 0) { return Error() << "Could not get process context"; |