Skip to content

Commit

Permalink
tun.c: enclose DNS domain in single quotes in WMIC call
Browse files Browse the repository at this point in the history
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).

Fixes OpenVPN#363

Change-Id: Iab536922d0731635cef529b5caf542f637b8d491
Signed-off-by: Lev Stipakov <lev@openvpn.net>
  • Loading branch information
lstipakov committed Jul 10, 2023
1 parent 53055fd commit bc8984c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/openvpn/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit bc8984c

Please sign in to comment.