Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a86cb76 authored by Tom Cherry's avatar Tom Cherry
Browse files

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
parent 672dd970
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -835,7 +835,9 @@ static int do_installkey(const std::vector<std::string>& args) {
}

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 {