summaryrefslogtreecommitdiff
path: root/init/builtins.cpp
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2016-07-15 16:21:34 -0600
committerJeff Sharkey <jsharkey@android.com>2016-07-15 16:21:42 -0600
commit2460cf8ee8c463836cc23fb879ca65799b1b40bb (patch)
tree9afa4371226776c05788590691ed11fc3fb203b0 /init/builtins.cpp
parent3a4083a0e0686793a14819e598fd67fea0df1674 (diff)
Only restorecon CE storage after unlocked.
On FBE devices, the filenames inside credential-encrypted directories are mangled until the key is installed. This means the initial restorecon at boot needs to skip these directories until the keys are installed. This CL changes the implementation of the "restorecon_recursive" built-in command to use the new SKIPCE flag to avoid labeling files in CE directories. vold will request a restorecon when the keys are actually installed. Bug: 30126557 Change-Id: I320584574a4d712c493b5bbd8a79b56c0c04aa58
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r--init/builtins.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp
index 56318771ff..70f919401b 100644
--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -875,8 +875,12 @@ static int do_restorecon_recursive(const std::vector<std::string>& args) {
int ret = 0;
for (auto it = std::next(args.begin()); it != args.end(); ++it) {
- if (restorecon_recursive(it->c_str()) < 0)
+ /* The contents of CE paths are encrypted on FBE devices until user
+ * credentials are presented (filenames inside are mangled), so we need
+ * to delay restorecon of those until vold explicitly requests it. */
+ if (restorecon_recursive_skipce(it->c_str()) < 0) {
ret = -errno;
+ }
}
return ret;
}