system/core
Revisão | 9ab24048d625254825ddb51bb7368186615e7d9f (tree) |
---|---|
Hora | 2019-12-17 14:24:56 |
Autor | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
init: don't bail out even no SELinux domain defined
@@ -29,6 +29,9 @@ | ||
29 | 29 | #include <sys/wait.h> |
30 | 30 | #include <termios.h> |
31 | 31 | #include <unistd.h> |
32 | +#if defined(__ANDROID__) | |
33 | +#include <cutils/klog.h> | |
34 | +#endif | |
32 | 35 | |
33 | 36 | #include <android-base/file.h> |
34 | 37 | #include <android-base/logging.h> |
@@ -94,11 +97,17 @@ static Result<std::string> ComputeContextFromExecutable(const std::string& servi | ||
94 | 97 | free(new_con); |
95 | 98 | } |
96 | 99 | if (rc == 0 && computed_context == mycon.get()) { |
100 | +#if defined(__ANDROID__) | |
101 | + KLOG_WARNING("service", "File %s (labeled \"%s\") has incorrect label or no domain transition from %s to another SELinux domain defined.", | |
102 | + service_path.c_str(), filecon.get(), mycon.get()); | |
103 | + return "skip"; | |
104 | +#else | |
97 | 105 | return Error() << "File " << service_path << "(labeled \"" << filecon.get() |
98 | 106 | << "\") has incorrect label or no domain transition from " << mycon.get() |
99 | 107 | << " to another SELinux domain defined. Have you configured your " |
100 | 108 | "service correctly? https://source.android.com/security/selinux/" |
101 | 109 | "device-policy#label_new_services_and_address_denials"; |
110 | +#endif | |
102 | 111 | } |
103 | 112 | if (rc < 0) { |
104 | 113 | return Error() << "Could not get process context"; |