Android-x86
Fork
Faire un don

  • R/O
  • HTTP
  • SSH
  • HTTPS

system-core: Commit

system/core


Commit MetaInfo

Révision952d62246c914bd5f5b5a8d2bff4aab69d90966e (tree)
l'heure2020-05-20 23:03:42
AuteurChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Message de Log

Merge remote-tracking branch 'lineage/cm-14.1' into cm-14.1-x86

Conflicts:
init/service.cpp

Change Summary

Modification

--- a/include/utils/Flattenable.h
+++ b/include/utils/Flattenable.h
@@ -19,6 +19,7 @@
1919
2020
2121 #include <stdint.h>
22+#include <string.h>
2223 #include <sys/types.h>
2324 #include <utils/Errors.h>
2425 #include <utils/Debug.h>
@@ -44,7 +45,12 @@ public:
4445
4546 template<int N>
4647 static size_t align(void*& buffer) {
47- return align<N>( const_cast<void const*&>(buffer) );
48+ static_assert(!(N & (N - 1)), "Can only align to a power of 2.");
49+ void* b = buffer;
50+ buffer = reinterpret_cast<void*>((uintptr_t(buffer) + (N-1)) & ~(N-1));
51+ size_t delta = size_t(uintptr_t(buffer) - uintptr_t(b));
52+ memset(b, 0, delta);
53+ return delta;
4854 }
4955
5056 static void advance(void*& buffer, size_t& size, size_t offset) {
--- a/init/service.cpp
+++ b/init/service.cpp
@@ -373,11 +373,11 @@ bool Service::Start() {
373373 }
374374 if (rc == 0 && scon == mycon) {
375375 ERROR("Service %s does not have a SELinux domain defined.\n", name_.c_str());
376-#if 0
377- free(mycon);
378- free(fcon);
379- return false;
380-#endif
376+ if (selinux_status_getenforce() > 0) {
377+ free(mycon);
378+ free(fcon);
379+ return false;
380+ }
381381 }
382382 free(mycon);
383383 free(fcon);
Afficher sur ancien navigateur de dépôt.