From: Heiko Hund Date: Fri, 27 Jun 2025 08:24:53 +0000 (+0200) Subject: dns: create NRPT registry key if it doesn't exist X-Git-Tag: v2.7_alpha3~46 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=df4863aa0e43544ea82ab9d98966a03a95c62334;p=thirdparty%2Fopenvpn.git dns: create NRPT registry key if it doesn't exist Windows 2019 Server by default does not have the key where local system NRPT rules are stored. Tests have determined that NRPT is actually working when rules are created under the key. So, instead of failing if the key doesn't exist, we create it, and things will start working. Github: OpenVPN/openvpn#768 Change-Id: I46132ebaf3bf3b16798b6f2416f7bf7272f5646b Signed-off-by: Heiko Hund Acked-by: Lev Stipakov Message-Id: <20250627082500.17075-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32001.html Signed-off-by: Gert Doering --- diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index 3bd2722e6..628a96bc6 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -2662,7 +2662,7 @@ OpenNrptBaseKey(PHKEY key, PBOOL gpol) if (err == ERROR_FILE_NOT_FOUND) { *gpol = FALSE; - err = RegOpenKeyExA(HKEY_LOCAL_MACHINE, sys_key, 0, KEY_ALL_ACCESS, &nrpt); + err = RegCreateKeyExA(HKEY_LOCAL_MACHINE, sys_key, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &nrpt, NULL); if (err) { nrpt = INVALID_HANDLE_VALUE;