From: Vilbrekin Date: Wed, 22 Aug 2012 08:46:24 +0000 (+0200) Subject: Basic patch for android cross-compilation. X-Git-Tag: 1.0.19-android-1~4 X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=347c1d47077faecf900fdad8f7003e8ea43507d3;p=tinc 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... --- diff --git a/src/process.c b/src/process.c index f33355ce..41a1468d 100644 --- a/src/process.c +++ b/src/process.c @@ -376,6 +376,16 @@ bool execute_script(const char *name, char **envp) { free(scriptname); 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 ifdebug(STATUS) logger(LOG_INFO, "Executing script %s", name); diff --git a/src/tincd.c b/src/tincd.c index 4f03db6f..7b74cd6c 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -467,8 +467,9 @@ static bool drop_privs() { "initgroups", strerror(errno)); return false; } - endgrent(); - endpwent(); + // Not supported in android NDK + //endgrent(); + //endpwent(); } if (do_chroot) { tzset(); /* for proper timestamps in logs */