aboutsummaryrefslogtreecommitdiff
path: root/src/openvpn/misc.c
diff options
context:
space:
mode:
authorHeiko Hund2016-10-28 18:42:40 +0200
committerGert Doering2016-11-14 20:34:26 +0100
commit253609124459f8df96e059bba9c164299a32318e (patch)
tree4019da1a6f0e4a19c520ef3b77d37b8e490536b0 /src/openvpn/misc.c
parentd6ab1dc49e5c8018f58e7c3c9fe64f4289ccc77b (diff)
downloadopenvpn-253609124459f8df96e059bba9c164299a32318e.zip
openvpn-253609124459f8df96e059bba9c164299a32318e.tar.gz
Factor out %sc handling from argv_printf()
Move functionality to parse command strings into argv_parse_cmd(). That is a preparation for the upcoming refactoring of argv_printf(). Signed-off-by: Heiko Hund <heiko.hund@sophos.com> Acked-by: David Sommerseth <davids@redhat.com> Message-Id: <1477672963-5724-5-git-send-email-heiko.hund@sophos.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg12816.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'src/openvpn/misc.c')
-rw-r--r--src/openvpn/misc.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/openvpn/misc.c b/src/openvpn/misc.c
index 3d40f0b..bc8b33c 100644
--- a/src/openvpn/misc.c
+++ b/src/openvpn/misc.c
@@ -120,13 +120,9 @@ run_up_down (const char *command,
struct argv argv = argv_new ();
ASSERT (arg);
setenv_str (es, "script_type", script_type);
- argv_printf (&argv,
- "%sc %s %d %d %s %s %s",
- command,
- arg,
- tun_mtu, link_mtu,
- ifconfig_local, ifconfig_remote,
- context);
+ argv_parse_cmd (&argv, command);
+ argv_printf_cat (&argv, "%s %d %d %s %s %s", arg, tun_mtu, link_mtu,
+ ifconfig_local, ifconfig_remote, context);
argv_msg (M_INFO, &argv);
openvpn_run_script (&argv, es, S_FATAL, "--up/--down");
argv_reset (&argv);