projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use __ANDROID__ define rather than dirty hard-code to allow android NDK cross-compila...
[tinc]
/
src
/
process.c
diff --git
a/src/process.c
b/src/process.c
index
41a1468
..
a682226
100644
(file)
--- a/
src/process.c
+++ b/
src/process.c
@@
-358,6
+358,7
@@
bool execute_script(const char *name, char **envp) {
int status, len;
char *scriptname;
int i;
int status, len;
char *scriptname;
int i;
+ char *aInterpreter = NULL;
#ifndef HAVE_MINGW
len = xasprintf(&scriptname, "\"%s/%s\"", confbase, name);
#ifndef HAVE_MINGW
len = xasprintf(&scriptname, "\"%s/%s\"", confbase, name);
@@
-376,17
+377,21
@@
bool execute_script(const char *name, char **envp) {
free(scriptname);
return true;
}
free(scriptname);
return true;
}
- else
+#endif
+
+ // Custom scripts interpreter
+ if(get_config_string(lookup_config(config_tree, "ScriptsInterpreter"), &aInterpreter))
{
{
- //
Ugly hard-code
allowing execution of scripts on android without execution flag (such as on /sdcard)
+ //
Force custom scripts interpreter
allowing execution of scripts on android without execution flag (such as on /sdcard)
free(scriptname);
free(scriptname);
- len = xasprintf(&scriptname, "
/system/bin/sh \"%s/%s\""
, confbase, name);
+ len = xasprintf(&scriptname, "
%s \"%s/%s\"", aInterpreter
, confbase, name);
if(len < 0)
{
if(len < 0)
{
+ free(aInterpreter);
return false;
}
}
return false;
}
}
-#endif
+ free(aInterpreter);
ifdebug(STATUS) logger(LOG_INFO, "Executing script %s", name);
ifdebug(STATUS) logger(LOG_INFO, "Executing script %s", name);