]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
tun.c: enclose DNS domain in single quotes in WMIC call
authorLev Stipakov <lev@openvpn.net>
Mon, 10 Jul 2023 11:21:22 +0000 (14:21 +0300)
committerGert Doering <gert@greenie.muc.de>
Tue, 11 Jul 2023 19:23:09 +0000 (21:23 +0200)
This is needed to support domains with hyphens.

Not using double quotes here, since our code replaces
them with underbars (see
https://github.com/OpenVPN/openvpn/blob/master/src/openvpn/win32.c#L980).

Github: fixes OpenVPN/openvpn#363

Change-Id: Iab536922d0731635cef529b5caf542f637b8d491
Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Selva Nair <selva.nair@gmail.com>
Message-Id: <20230710112122.576-1-lstipakov@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26841.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/tun.c

index d1fd6defce2a4761e65c3f0907ac8da7ff6a86ed..60974208ef0e236d3c3da4b36fdc01586b85ece9 100644 (file)
@@ -333,7 +333,7 @@ do_dns_domain_wmic(bool add, const struct tuntap *tt)
     }
 
     struct argv argv = argv_new();
-    argv_printf(&argv, "%s%s nicconfig where (InterfaceIndex=%ld) call SetDNSDomain %s",
+    argv_printf(&argv, "%s%s nicconfig where (InterfaceIndex=%ld) call SetDNSDomain '%s'",
                 get_win_sys_path(), WMIC_PATH_SUFFIX, tt->adapter_index, add ? tt->options.domain : "");
     exec_command("WMIC", &argv, 1, M_WARN);