Basic patch for android cross-compilation.
Commented non-existing functions in android NDK. Prefix scripts execution with shell binary to allow execution on no-exec mount points. Everyything is currently hard coded, while it should use pre-compiler variables...
This commit is contained in:
parent
3391018efb
commit
8a6f278fd2
2 changed files with 13 additions and 2 deletions
|
@ -376,6 +376,16 @@ bool execute_script(const char *name, char **envp) {
|
||||||
free(scriptname);
|
free(scriptname);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Ugly hard-code allowing execution of scripts on android without execution flag (such as on /sdcard)
|
||||||
|
free(scriptname);
|
||||||
|
len = xasprintf(&scriptname, "/system/bin/sh \"%s/%s\"", confbase, name);
|
||||||
|
if(len < 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ifdebug(STATUS) logger(LOG_INFO, "Executing script %s", name);
|
ifdebug(STATUS) logger(LOG_INFO, "Executing script %s", name);
|
||||||
|
|
|
@ -467,8 +467,9 @@ static bool drop_privs() {
|
||||||
"initgroups", strerror(errno));
|
"initgroups", strerror(errno));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
endgrent();
|
// Not supported in android NDK
|
||||||
endpwent();
|
//endgrent();
|
||||||
|
//endpwent();
|
||||||
}
|
}
|
||||||
if (do_chroot) {
|
if (do_chroot) {
|
||||||
tzset(); /* for proper timestamps in logs */
|
tzset(); /* for proper timestamps in logs */
|
||||||
|
|
Loading…
Reference in a new issue