Unverified Commit 0a0e05aa by Christian Brauner Committed by GitHub

Merge pull request #2792 from kubiko/fix-android-hooks

Fixing hooks functionality Android where 'sh' is placed under /system
parents 6f16ac1f ecfa5693
......@@ -447,7 +447,12 @@ struct lxc_popen_FILE *lxc_popen(const char *command)
if (ret < 0)
_exit(EXIT_FAILURE);
execl("/bin/sh", "sh", "-c", command, (char *)NULL);
/* check if /bin/sh exist, otherwise try Android location /system/bin/sh */
if (file_exists("/bin/sh"))
execl("/bin/sh", "sh", "-c", command, (char *)NULL);
else
execl("/system/bin/sh", "sh", "-c", command, (char *)NULL);
_exit(127);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment