diff options
author | David Sommerseth <dazo@users.sourceforge.net> | 2010-07-22 22:33:16 +0200 |
---|---|---|
committer | David Sommerseth <dazo@users.sourceforge.net> | 2010-07-22 22:33:16 +0200 |
commit | 0b026a985d6232d459ed4e2b6642853c959667da (patch) | |
tree | a43bbe677b158de41f32bb240358ec4c1d2f34b2 /misc.h | |
parent | Merge branch 'bugfix2.1' into beta2.2 (diff) | |
parent | Fixed static defined length check to use sizeof() (diff) | |
download | openvpn-0b026a985d6232d459ed4e2b6642853c959667da.tar.xz |
Merge branch 'feat_misc' into beta2.2
Conflicts:
Makefile.am
- Copyright update
- Added configure.h to CLEANFILES
options.c
- Copyright update
- More verbose information about enabled features
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Diffstat (limited to 'misc.h')
-rw-r--r-- | misc.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -136,6 +136,15 @@ bool openvpn_execve_check (const struct argv *a, const struct env_set *es, const bool openvpn_execve_allowed (const unsigned int flags); int openvpn_system (const char *command, const struct env_set *es, unsigned int flags); +static inline bool +openvpn_run_script (const struct argv *a, const struct env_set *es, const unsigned int flags, const char *hook) +{ + char msg[256]; + + openvpn_snprintf(msg, sizeof(msg), "WARNING: Failed running command (%s)", hook); + return openvpn_execve_check(a, es, flags | S_SCRIPT, msg); +}; + #ifdef HAVE_STRERROR /* a thread-safe version of strerror */ const char* strerror_ts (int errnum, struct gc_arena *gc); @@ -308,6 +317,7 @@ void get_user_pass_auto_userid (struct user_pass *up, const char *tag); extern const char *iproute_path; #endif +/* Script security */ #define SSEC_NONE 0 /* strictly no calling of external programs */ #define SSEC_BUILT_IN 1 /* only call built-in programs such as ifconfig, route, netsh, etc.*/ #define SSEC_SCRIPTS 2 /* allow calling of built-in programs and user-defined scripts */ |