aboutsummaryrefslogtreecommitdiff
path: root/misc.h
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2008-11-17 04:28:07 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2008-11-17 04:28:07 +0000
commita82813527551f0e79c6d6ed5a9c1162e3c171bcf (patch)
tree65e82c2976c568a6f4099b8518c490c4d603e4cb /misc.h
parentInterim release. (diff)
downloadopenvpn-a82813527551f0e79c6d6ed5a9c1162e3c171bcf.tar.xz
* Added additional method parameter to --script-security to preserve
backward compatibility with system() call semantics used in OpenVPN 2.1_rc8 and earlier. To preserve backward compatibility use: script-security 3 system git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@3495 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'misc.h')
-rw-r--r--misc.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/misc.h b/misc.h
index a9c011a..d96d171 100644
--- a/misc.h
+++ b/misc.h
@@ -36,6 +36,14 @@
/* forward declarations */
struct plugin_list;
+/* used by argv_x functions */
+struct argv {
+ size_t capacity;
+ size_t argc;
+ char **argv;
+ char *system_str;
+};
+
/*
* Handle environmental variable lists
*/
@@ -126,6 +134,7 @@ const char *system_error_message (int, struct gc_arena *gc);
int openvpn_execve (const struct argv *a, const struct env_set *es, const unsigned int flags);
bool openvpn_execve_check (const struct argv *a, const struct env_set *es, const unsigned int flags, const char *error_message);
bool openvpn_execve_allowed (const unsigned int flags);
+int openvpn_system (const char *command, const struct env_set *es, unsigned int flags);
#ifdef HAVE_STRERROR
/* a thread-safe version of strerror */
@@ -297,9 +306,16 @@ extern const char *iproute_path;
#define SSEC_PW_ENV 3 /* allow calling of built-in programs and user-defined scripts that may receive a password as an environmental variable */
extern int script_security; /* GLOBAL */
+#define SM_EXECVE 0 /* call external programs with execve() or CreateProcess() */
+#define SM_SYSTEM 1 /* call external programs with system() */
+extern int script_method; /* GLOBAL */
+
/* return the next largest power of 2 */
size_t adjust_power_of_2 (size_t u);
+/* return the basename of path */
+const char *openvpn_basename (const char *path);
+
/*
* A printf-like function (that only recognizes a subset of standard printf
* format operators) that prints arguments to an argv list instead
@@ -314,6 +330,7 @@ const char *argv_str (const struct argv *a, struct gc_arena *gc, const unsigned
struct argv argv_insert_head (const struct argv *a, const char *head);
void argv_msg (const int msglev, const struct argv *a);
void argv_msg_prefix (const int msglev, const struct argv *a, const char *prefix);
+const char *argv_system_str (const struct argv *a);
#define APA_CAT (1<<0) /* concatentate onto existing struct argv list */
void argv_printf_arglist (struct argv *a, const char *format, const unsigned int flags, va_list arglist);