init: use do_exec() for init_user0
Similar to what installkey used to do, init_user0 forks and
synchronously waits for vdc to return. This is dangerous to do in
init however as init also processes properties from a single thread.
I'm not aware of any specific issues that this is currently causing,
but it's a good preventative measure to match what installkey does and
use do_exec().
Test: Boot bullhead, see that init_user0 still happens
Change-Id: I853c61594fe3d97e91bbb2319ebddf2bbe80d457
diff --git a/init/builtins.cpp b/init/builtins.cpp
index 559fb84..3dadfd7 100644
--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -835,7 +835,9 @@
}
static int do_init_user0(const std::vector<std::string>& args) {
- return e4crypt_do_init_user0();
+ std::vector<std::string> exec_args = {"exec", "/system/bin/vdc", "--wait", "cryptfs",
+ "init_user0"};
+ return do_exec(exec_args);
}
const BuiltinFunctionMap::Map& BuiltinFunctionMap::map() const {