diff options
author | Fyodor Kupolov <fkupolov@google.com> | 2015-04-07 20:49:09 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-04-07 20:49:09 +0000 |
commit | 7897031f3e5292fb744445557b755fcb28f11329 (patch) | |
tree | b83231e3f4185a9c523e7b63d5eef3ee79b0c6d5 /cmds | |
parent | c9a737b5269accb3eabed2cd211baf001db602b5 (diff) | |
parent | b58e6cbfa726add05bbe5e31e8ca13815ccf2049 (diff) | |
download | frameworks_native-7897031f3e5292fb744445557b755fcb28f11329.zip frameworks_native-7897031f3e5292fb744445557b755fcb28f11329.tar.gz frameworks_native-7897031f3e5292fb744445557b755fcb28f11329.tar.bz2 |
am b58e6cbf: am 4914f85f: am 8f43f77d: Merge "Use AID_SYSTEM as uid when creating oat dir"
* commit 'b58e6cbfa726add05bbe5e31e8ca13815ccf2049':
Use AID_SYSTEM as uid when creating oat dir
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/installd/commands.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index 821ef1c..5f72ae4 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -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; |