Unverified Commit 3d277c51 by ondra Committed by Christian Brauner

Fixing hooks functionality Android where 'sh' is placed under /system/bin

parent b2de32b2
...@@ -501,7 +501,12 @@ struct lxc_popen_FILE *lxc_popen(const char *command) ...@@ -501,7 +501,12 @@ struct lxc_popen_FILE *lxc_popen(const char *command)
if (ret < 0) if (ret < 0)
_exit(EXIT_FAILURE); _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); _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