Loading PREUPLOAD.cfg +1 −0 Original line number Original line Diff line number Diff line [Builtin Hooks] [Builtin Hooks] clang_format = true clang_format = true rustfmt = true rustfmt = true bpfmt = true [Builtin Hooks Options] [Builtin Hooks Options] clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp Loading fs_mgr/tests/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -14,6 +14,7 @@ package { package { default_applicable_licenses: ["Android-Apache-2.0"], default_applicable_licenses: ["Android-Apache-2.0"], default_team: "trendy_team_android_kernel", } } cc_test { cc_test { Loading init/Android.bp +10 −0 Original line number Original line Diff line number Diff line Loading @@ -569,6 +569,11 @@ cc_library_static { ], ], export_include_dirs: ["test_utils/include"], // for tests export_include_dirs: ["test_utils/include"], // for tests header_libs: ["bionic_libc_platform_headers"], header_libs: ["bionic_libc_platform_headers"], product_variables: { shipping_api_level: { cflags: ["-DBUILD_SHIPPING_API_LEVEL=%s"], }, }, } } // Host Verifier // Host Verifier Loading Loading @@ -623,6 +628,11 @@ cc_defaults { enabled: false, enabled: false, }, }, }, }, product_variables: { shipping_api_level: { cflags: ["-DBUILD_SHIPPING_API_LEVEL=%s"], }, }, } } cc_binary { cc_binary { Loading init/host_init_stubs.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -32,6 +32,7 @@ #define __ANDROID_API_S__ 31 #define __ANDROID_API_S__ 31 #define __ANDROID_API_T__ 33 #define __ANDROID_API_T__ 33 #define __ANDROID_API_U__ 34 #define __ANDROID_API_U__ 34 #define __ANDROID_API_V__ 35 // sys/system_properties.h // sys/system_properties.h #define PROP_VALUE_MAX 92 #define PROP_VALUE_MAX 92 Loading init/service_parser.cpp +14 −1 Original line number Original line Diff line number Diff line Loading @@ -52,6 +52,18 @@ using android::base::StartsWith; namespace android { namespace android { namespace init { namespace init { #ifdef INIT_FULL_SOURCES // on full sources, we have better information on device to // make this decision constexpr bool kAlwaysErrorUserRoot = false; #else constexpr uint64_t kBuildShippingApiLevel = BUILD_SHIPPING_API_LEVEL + 0 /* +0 if empty */; // on partial sources, the host build, we don't have the specific // vendor API level, but we can enforce things based on the // shipping API level. constexpr bool kAlwaysErrorUserRoot = kBuildShippingApiLevel > __ANDROID_API_V__; #endif Result<void> ServiceParser::ParseCapabilities(std::vector<std::string>&& args) { Result<void> ServiceParser::ParseCapabilities(std::vector<std::string>&& args) { service_->capabilities_ = 0; service_->capabilities_ = 0; Loading Loading @@ -680,7 +692,8 @@ Result<void> ServiceParser::EndSection() { } } if (service_->proc_attr_.parsed_uid == std::nullopt) { if (service_->proc_attr_.parsed_uid == std::nullopt) { if (android::base::GetIntProperty("ro.vendor.api_level", 0) > 202404) { if (kAlwaysErrorUserRoot || android::base::GetIntProperty("ro.vendor.api_level", 0) > 202404) { return Error() << "No user specified for service '" << service_->name() return Error() << "No user specified for service '" << service_->name() << "', so it would have been root."; << "', so it would have been root."; } else { } else { Loading Loading
PREUPLOAD.cfg +1 −0 Original line number Original line Diff line number Diff line [Builtin Hooks] [Builtin Hooks] clang_format = true clang_format = true rustfmt = true rustfmt = true bpfmt = true [Builtin Hooks Options] [Builtin Hooks Options] clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp Loading
fs_mgr/tests/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -14,6 +14,7 @@ package { package { default_applicable_licenses: ["Android-Apache-2.0"], default_applicable_licenses: ["Android-Apache-2.0"], default_team: "trendy_team_android_kernel", } } cc_test { cc_test { Loading
init/Android.bp +10 −0 Original line number Original line Diff line number Diff line Loading @@ -569,6 +569,11 @@ cc_library_static { ], ], export_include_dirs: ["test_utils/include"], // for tests export_include_dirs: ["test_utils/include"], // for tests header_libs: ["bionic_libc_platform_headers"], header_libs: ["bionic_libc_platform_headers"], product_variables: { shipping_api_level: { cflags: ["-DBUILD_SHIPPING_API_LEVEL=%s"], }, }, } } // Host Verifier // Host Verifier Loading Loading @@ -623,6 +628,11 @@ cc_defaults { enabled: false, enabled: false, }, }, }, }, product_variables: { shipping_api_level: { cflags: ["-DBUILD_SHIPPING_API_LEVEL=%s"], }, }, } } cc_binary { cc_binary { Loading
init/host_init_stubs.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -32,6 +32,7 @@ #define __ANDROID_API_S__ 31 #define __ANDROID_API_S__ 31 #define __ANDROID_API_T__ 33 #define __ANDROID_API_T__ 33 #define __ANDROID_API_U__ 34 #define __ANDROID_API_U__ 34 #define __ANDROID_API_V__ 35 // sys/system_properties.h // sys/system_properties.h #define PROP_VALUE_MAX 92 #define PROP_VALUE_MAX 92 Loading
init/service_parser.cpp +14 −1 Original line number Original line Diff line number Diff line Loading @@ -52,6 +52,18 @@ using android::base::StartsWith; namespace android { namespace android { namespace init { namespace init { #ifdef INIT_FULL_SOURCES // on full sources, we have better information on device to // make this decision constexpr bool kAlwaysErrorUserRoot = false; #else constexpr uint64_t kBuildShippingApiLevel = BUILD_SHIPPING_API_LEVEL + 0 /* +0 if empty */; // on partial sources, the host build, we don't have the specific // vendor API level, but we can enforce things based on the // shipping API level. constexpr bool kAlwaysErrorUserRoot = kBuildShippingApiLevel > __ANDROID_API_V__; #endif Result<void> ServiceParser::ParseCapabilities(std::vector<std::string>&& args) { Result<void> ServiceParser::ParseCapabilities(std::vector<std::string>&& args) { service_->capabilities_ = 0; service_->capabilities_ = 0; Loading Loading @@ -680,7 +692,8 @@ Result<void> ServiceParser::EndSection() { } } if (service_->proc_attr_.parsed_uid == std::nullopt) { if (service_->proc_attr_.parsed_uid == std::nullopt) { if (android::base::GetIntProperty("ro.vendor.api_level", 0) > 202404) { if (kAlwaysErrorUserRoot || android::base::GetIntProperty("ro.vendor.api_level", 0) > 202404) { return Error() << "No user specified for service '" << service_->name() return Error() << "No user specified for service '" << service_->name() << "', so it would have been root."; << "', so it would have been root."; } else { } else { Loading