Skip to content

Commit

Permalink
Merge pull request #12 from RomikB/pipe_rebranding
Browse files Browse the repository at this point in the history
unsafe rebranding: change pipe name for windows
  • Loading branch information
pokamest committed May 6, 2024
2 parents d33c4b6 + 776a1b5 commit e42813c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ipc-uapi-windows.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static FILE *userspace_interface_file(const char *iface)
if (!CreateWellKnownSid(WinLocalSystemSid, NULL, &expected_sid, &bytes))
goto err;

snprintf(fname, sizeof(fname), "\\\\.\\pipe\\ProtectedPrefix\\Administrators\\WireGuard\\%s", iface);
snprintf(fname, sizeof(fname), "\\\\.\\pipe\\ProtectedPrefix\\Administrators\\AmneziaWG\\%s", iface);
pipe_handle = CreateFileA(fname, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
if (pipe_handle == INVALID_HANDLE_VALUE)
goto err;
Expand Down Expand Up @@ -62,7 +62,7 @@ static bool userspace_has_wireguard_interface(const char *iface)
if (have_cached_interfaces)
return hashtable_find_entry(&cached_interfaces, iface) != NULL;

snprintf(fname, sizeof(fname), "ProtectedPrefix\\Administrators\\WireGuard\\%s", iface);
snprintf(fname, sizeof(fname), "ProtectedPrefix\\Administrators\\AmneziaWG\\%s", iface);
find_handle = FindFirstFile("\\\\.\\pipe\\*", &find_data);
if (find_handle == INVALID_HANDLE_VALUE)
return -EIO;
Expand All @@ -78,7 +78,7 @@ static bool userspace_has_wireguard_interface(const char *iface)

static int userspace_get_wireguard_interfaces(struct string_list *list)
{
static const char prefix[] = "ProtectedPrefix\\Administrators\\WireGuard\\";
static const char prefix[] = "ProtectedPrefix\\Administrators\\AmneziaWG\\";
WIN32_FIND_DATA find_data;
HANDLE find_handle;
char *iface;
Expand Down

0 comments on commit e42813c

Please sign in to comment.