debugd: Refactor code for getting debugd helper path.
This CL refactors code for getting debugd helper path into
SandboxedProcess::GetHelperPath().
BUG=chromium:373578
TEST=Tested the following:
1. Build and run unit tests.
2. Run the command below in a root shell:
dbus-send --system --print-reply --dest=org.chromium.debugd \
/org/chromium/debugd org.chromium.debugd.TestICMP \
string:8.8.8.8
dbus-send --system --print-reply --dest=org.chromium.debugd \
/org/chromium/debugd org.chromium.debugd.Smartctl \
string:capabilities
dbus-send --system --print-reply --dest=org.chromium.debugd \
/org/chromium/debugd org.chromium.debugd.GetModemStatus
dbus-send --system --print-reply --dest=org.chromium.debugd \
/org/chromium/debugd org.chromium.debugd.GetWiMaxStatus
restart debugd DEBUGD_HELPERS=/tmp
# Now the following command should fail as debugd tries to find the
# helper executable from /tmp
dbus-send --system --print-reply --dest=org.chromium.debugd \
/org/chromium/debugd org.chromium.debugd.GetWiMaxStatus
Change-Id: I29b17a9f61ef330e90be493a20b6f236eb307fb8
Reviewed-on: https://chromium-review.googlesource.com/200000
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
13 files changed