From be969b7fe1ceda4f2df839e622ec1e27db0667c9 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 19 Mar 2020 16:33:14 -0600 Subject: wincompat: use new protected prefix on Windows Signed-off-by: Jason A. Donenfeld --- src/wincompat/ipc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/wincompat/ipc.c b/src/wincompat/ipc.c index ce8fdb6..86fab07 100644 --- a/src/wincompat/ipc.c +++ b/src/wincompat/ipc.c @@ -115,6 +115,7 @@ err: static int userspace_get_wireguard_interfaces(struct string_list *list) { + static const char prefix[] = "ProtectedPrefix\\Administrators\\WireGuard\\"; WIN32_FIND_DATA find_data; HANDLE find_handle; int ret = 0; @@ -123,9 +124,9 @@ static int userspace_get_wireguard_interfaces(struct string_list *list) if (find_handle == INVALID_HANDLE_VALUE) return -GetLastError(); do { - if (strncmp("WireGuard\\", find_data.cFileName, 10)) + if (strncmp(prefix, find_data.cFileName, strlen(prefix))) continue; - ret = string_list_add(list, find_data.cFileName + 10); + ret = string_list_add(list, find_data.cFileName + strlen(prefix)); if (ret < 0) goto out; } while (FindNextFile(find_handle, &find_data)); -- cgit v1.2.3-59-g8ed1b