From: Lev Stipakov Date: Mon, 10 Jul 2023 11:21:22 +0000 (+0300) Subject: tun.c: enclose DNS domain in single quotes in WMIC call X-Git-Tag: v2.6.6~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aceecaef79cd2dae5265e328874ee8263ac79492;p=thirdparty%2Fopenvpn.git tun.c: enclose DNS domain in single quotes in WMIC call 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 Acked-by: Selva Nair 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 (cherry picked from commit 4057814a8a783d4fb1475f49f073f6b3a7797677) --- diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 4ef390ad5..af959bbda 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -335,7 +335,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);