diff options
author | David Sommerseth <dazo@users.sourceforge.net> | 2008-09-27 12:04:15 +0200 |
---|---|---|
committer | David Sommerseth <dazo@users.sourceforge.net> | 2008-09-27 12:04:15 +0200 |
commit | 9e9bcaf3315a7252e712549af615a7b9bd892b78 (patch) | |
tree | 533adcf3cf97a91b5c0145e3c4d97e56454b0cd3 | |
parent | eab5e59497aa5e71e8b22c5a5622febb2540ed89 (diff) | |
download | eurephia-9e9bcaf3315a7252e712549af615a7b9bd892b78.tar.gz eurephia-9e9bcaf3315a7252e712549af615a7b9bd892b78.tar.xz eurephia-9e9bcaf3315a7252e712549af615a7b9bd892b78.zip |
Show all environment variables and and all arguments in log file
If ENABLE_DEBUG is enabled and log level > 30, environment and arguments
are dumped into log file
-rw-r--r-- | eurephia-auth.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/eurephia-auth.c b/eurephia-auth.c index c4ac5b5..8831581 100644 --- a/eurephia-auth.c +++ b/eurephia-auth.c @@ -56,6 +56,13 @@ static const char *plugin_type_name(const int type) return "(UNKNOWN PLUGIN CODE)"; } } + +static void dump_env(FILE *f, const char *prefix, const char *envp[]) { + int i; + for (i = 0; envp[i]; i++) { + fprintf(f, "%s%s\n", prefix, envp[i]); + } +} #endif @@ -123,6 +130,13 @@ OPENVPN_EXPORT int openvpn_plugin_func_v1(openvpn_plugin_handle_t handle, DEBUG(ctx, 10, "openvpn_plugin_func_v1(ctx, %s, ...)", plugin_type_name(type)); +#ifdef ENABLE_DEBUG + if( ctx->loglevel >= 30 ) { + dump_env(ctx->log, "ENV: ", envp); + dump_env(ctx->log, "ARG: ", argv); + } +#endif + switch( type ) { case OPENVPN_PLUGIN_TLS_VERIFY: result = eurephia_tlsverify(ctx, envp, argv[1]); |