aboutsummaryrefslogtreecommitdiff
path: root/multi.c
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2010-04-16 22:09:48 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2010-10-21 11:37:03 +0200
commit495e3cec5d15655058cd70983b8a0d65bd403d84 (patch)
tree0d3079adfccdb24f3c4e1cd192ebf05882f23ded /multi.c
parentHarden create_temp_filename() (version 2) (diff)
downloadopenvpn-495e3cec5d15655058cd70983b8a0d65bd403d84.tar.xz
Renamed all calls to create_temp_filename()
All places where create_temp_filename() was called are now calling create_temp_file(). Extra checks on the result of create_temp_file() is added in addition. Signed-off-by: David Sommerseth <dazo@users.sourceforge.net> Acked-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'multi.c')
-rw-r--r--multi.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/multi.c b/multi.c
index 2808c9b..0e00607 100644
--- a/multi.c
+++ b/multi.c
@@ -1530,7 +1530,13 @@ multi_connection_established (struct multi_context *m, struct multi_instance *mi
if (plugin_defined (mi->context.plugins, OPENVPN_PLUGIN_CLIENT_CONNECT))
{
struct argv argv = argv_new ();
- const char *dc_file = create_temp_filename (mi->context.options.tmp_dir, "cc", &gc);
+ const char *dc_file = create_temp_file (mi->context.options.tmp_dir, "cc", &gc);
+
+ if( !dc_file ) {
+ cc_succeeded = false;
+ goto script_depr_failed;
+ }
+
argv_printf (&argv, "%s", dc_file);
delete_file (dc_file);
if (plugin_call (mi->context.plugins, OPENVPN_PLUGIN_CLIENT_CONNECT, &argv, NULL, mi->context.c2.es) != OPENVPN_PLUGIN_FUNC_SUCCESS)
@@ -1543,6 +1549,7 @@ multi_connection_established (struct multi_context *m, struct multi_instance *mi
multi_client_connect_post (m, mi, dc_file, option_permissions_mask, &option_types_found);
++cc_succeeded_count;
}
+ script_depr_failed:
argv_reset (&argv);
}
@@ -1578,9 +1585,11 @@ multi_connection_established (struct multi_context *m, struct multi_instance *mi
setenv_str (mi->context.c2.es, "script_type", "client-connect");
- dc_file = create_temp_filename (mi->context.options.tmp_dir, "cc", &gc);
-
- delete_file (dc_file);
+ dc_file = create_temp_file (mi->context.options.tmp_dir, "cc", &gc);
+ if( !dc_file ) {
+ cc_succeeded = false;
+ goto script_failed;
+ }
argv_printf (&argv, "%sc %s",
mi->context.options.client_connect_script,
@@ -1593,7 +1602,7 @@ multi_connection_established (struct multi_context *m, struct multi_instance *mi
}
else
cc_succeeded = false;
-
+ script_failed:
argv_reset (&argv);
}