Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a636a887 authored by Eric Biggers's avatar Eric Biggers Committed by Automerger Merge Worker
Browse files

Merge "init: avoid ERROR log due to missing SEPolicy.zip" into main am: 0306bc1a

parents 6471b231 0306bc1a
Loading
Loading
Loading
Loading
+10 −4
Original line number Original line Diff line number Diff line
@@ -667,10 +667,16 @@ void CleanupApexSepolicy() {
//
//
void PrepareApexSepolicy() {
void PrepareApexSepolicy() {
    // If apex sepolicy zip exists in /metadata/sepolicy, use that, otherwise use version on
    // If apex sepolicy zip exists in /metadata/sepolicy, use that, otherwise use version on
    // /system.
    // /system. If neither exists, do nothing.
    auto dir = (access((kSepolicyApexMetadataDir + kSepolicyZip).c_str(), F_OK) == 0)
    std::string dir;
                       ? kSepolicyApexMetadataDir
    if (access((kSepolicyApexMetadataDir + kSepolicyZip).c_str(), F_OK) == 0) {
                       : kSepolicyApexSystemDir;
        dir = kSepolicyApexMetadataDir;
    } else if (access((kSepolicyApexSystemDir + kSepolicyZip).c_str(), F_OK) == 0) {
        dir = kSepolicyApexSystemDir;
    } else {
        LOG(INFO) << "APEX Sepolicy not found";
        return;
    }


    auto sepolicyVerify = SepolicyVerify(dir);
    auto sepolicyVerify = SepolicyVerify(dir);
    if (!sepolicyVerify.ok()) {
    if (!sepolicyVerify.ok()) {