diff options
author | Oli Lan <olilan@google.com> | 2020-01-03 10:04:31 +0000 |
---|---|---|
committer | Oli Lan <olilan@google.com> | 2020-01-03 16:47:38 +0000 |
commit | dc5167205d0f72302d7daf833ac0606bd1401bb4 (patch) | |
tree | c5d47d5a1832f8615cfa42aa803ddbaa64dec0eb /init/builtins.cpp | |
parent | 24ccfc244bdaffd911fed13903a467dfad9ff651 (diff) |
Change ownership of apex data directories to root.
The apex data directories must be accessed by apexd in order for it to
perform snapshot and restore as part of the rollback process. As apexd
runs as root, this CL changes the apex data directories under /data/misc
to be owned by root.
Bug: 141148175
Test: Build and flash; check permissions are set correctly.
Change-Id: Ib534e705802c06900884a15f39fee257d4987f4c
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r-- | init/builtins.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp index 64d9c5907..2a6df84f1 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -60,6 +60,7 @@ #include <fscrypt/fscrypt.h> #include <libgsi/libgsi.h> #include <logwrap/logwrap.h> +#include <private/android_filesystem_config.h> #include <selinux/android.h> #include <selinux/label.h> #include <selinux/selinux.h> @@ -1266,9 +1267,7 @@ static Result<void> create_apex_data_dirs() { if (strchr(name, '@') != nullptr) continue; auto path = "/data/misc/apexdata/" + std::string(name); - auto system_uid = DecodeUid("system"); - auto options = - MkdirOptions{path, 0700, *system_uid, *system_uid, FscryptAction::kNone, "ref"}; + auto options = MkdirOptions{path, 0770, AID_ROOT, AID_SYSTEM, FscryptAction::kNone, "ref"}; make_dir_with_options(options); } return {}; |