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

Commit 7897031f authored by Fyodor Kupolov's avatar Fyodor Kupolov Committed by Android Git Automerger
Browse files

am b58e6cbf: am 4914f85f: am 8f43f77d: Merge "Use AID_SYSTEM as uid when creating oat dir"

* commit 'b58e6cbf':
  Use AID_SYSTEM as uid when creating oat dir
parents c9a737b5 b58e6cbf
Loading
Loading
Loading
Loading
+2 −12
Original line number Diff line number Diff line
@@ -1712,12 +1712,7 @@ int create_oat_dir(const char* oat_dir, const char* instruction_set)
        ALOGE("invalid apk path '%s' (bad prefix)\n", oat_dir);
        return -1;
    }
    if ((mkdir(oat_dir, S_IRWXU|S_IRWXG|S_IXOTH) < 0) && (errno != EEXIST))  {
        ALOGE("cannot create dir '%s': %s\n", oat_dir, strerror(errno));
        return -1;
    }
    if (chmod(oat_dir, S_IRWXU|S_IRWXG|S_IXOTH) < 0) {
        ALOGE("cannot chmod dir '%s': %s\n", oat_dir, strerror(errno));
    if (fs_prepare_dir(oat_dir, S_IRWXU | S_IRWXG | S_IXOTH, AID_SYSTEM, AID_INSTALL)) {
        return -1;
    }
    if (selinux_android_restorecon(oat_dir, 0)) {
@@ -1725,12 +1720,7 @@ int create_oat_dir(const char* oat_dir, const char* instruction_set)
        return -1;
    }
    snprintf(oat_instr_dir, PKG_PATH_MAX, "%s/%s", oat_dir, instruction_set);
    if ((mkdir(oat_instr_dir, S_IRWXU|S_IRWXG|S_IXOTH) < 0)  && (errno != EEXIST)) {
        ALOGE("cannot create dir '%s': %s\n", oat_instr_dir, strerror(errno));
        return -1;
    }
    if (chmod(oat_instr_dir, S_IRWXU|S_IRWXG|S_IXOTH) < 0) {
        ALOGE("cannot chmod dir '%s': %s\n", oat_dir, strerror(errno));
    if (fs_prepare_dir(oat_instr_dir, S_IRWXU | S_IRWXG | S_IXOTH, AID_SYSTEM, AID_INSTALL)) {
        return -1;
    }
    return 0;