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

Commit 7bcc189b authored by Paul Lawrence's avatar Paul Lawrence
Browse files

Preserve environment when launching overlay_remounter

fexecve does not preserve the environment by default. The environment is
used to pass certain information to second stage init. Specifically
whether force debuggable is set is passed this way.

Test: Run following steps

vendor/google/tools/flashall --wipe --force_debuggable
adb shell getprop ro.adb.secure
adb root && adb remount && adb reboot
adb shell getprop ro.adb.secure

Without this change, the first getprop would return 0 and the second 1
With this change, both return 0

Bug: 397402912
Change-Id: I4722bd0c2960dd695dc096d8c59c259d12c28a65
parent e1b8be74
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -749,7 +749,7 @@ void SetupOverlays() {
        PLOG(FATAL) << "Failed to unlink " << or_dest;
    }
    const char* args[] = {or_dest.c_str(), nullptr};
    fexecve(dest.get(), const_cast<char**>(args), nullptr);
    fexecve(dest.get(), const_cast<char**>(args), environ);

    // execv() only returns if an error happened, in which case we
    // panic and never return from this function.