• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/core


Commit MetaInfo

修訂9ab24048d625254825ddb51bb7368186615e7d9f (tree)
時間2019-12-17 14:24:56
作者Chih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

init: don't bail out even no SELinux domain defined

Change Summary

差異

--- a/init/service.cpp
+++ b/init/service.cpp
@@ -29,6 +29,9 @@
2929 #include <sys/wait.h>
3030 #include <termios.h>
3131 #include <unistd.h>
32+#if defined(__ANDROID__)
33+#include <cutils/klog.h>
34+#endif
3235
3336 #include <android-base/file.h>
3437 #include <android-base/logging.h>
@@ -94,11 +97,17 @@ static Result<std::string> ComputeContextFromExecutable(const std::string& servi
9497 free(new_con);
9598 }
9699 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
97105 return Error() << "File " << service_path << "(labeled \"" << filecon.get()
98106 << "\") has incorrect label or no domain transition from " << mycon.get()
99107 << " to another SELinux domain defined. Have you configured your "
100108 "service correctly? https://source.android.com/security/selinux/"
101109 "device-policy#label_new_services_and_address_denials";
110+#endif
102111 }
103112 if (rc < 0) {
104113 return Error() << "Could not get process context";