diff options
author | Jeff Sharkey <jsharkey@android.com> | 2016-07-15 16:21:34 -0600 |
---|---|---|
committer | Paul Lawrence <paullawrence@google.com> | 2016-11-16 21:19:17 +0000 |
commit | d1d3bdd16fbaae87e0cfdb8d412f226e4aa390cf (patch) | |
tree | f3ab6e57aa4c9b7545e0da36003d3c1c8bf5271e /init/builtins.cpp | |
parent | 0673412bb962a2c92830e903acf442506d092ebc (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.
(cherrypicked from commit 1635afe83d1ebd6b5f1fac1e9c6c6b5cd1c93204)
Bug: 30126557
Test: Cherry-picked from master
Change-Id: I320584574a4d712c493b5bbd8a79b56c0c04aa58
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r-- | init/builtins.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp index ebdc8c993..08b591b5c 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -915,8 +915,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; } |