mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2025-01-23 22:39:01 +01:00
Append the microsecond-level connection time to the abstract socket name, making it always unique
This commit is contained in:
parent
7a695c976e
commit
9144045718
@ -20,6 +20,7 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <sys/time.h>
|
||||||
#include "websocket.h"
|
#include "websocket.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -227,9 +228,13 @@ void proxy_handler(ws_ctx_t *ws_ctx) {
|
|||||||
strcpy(addr.sun_path, ".KasmVNCSock");
|
strcpy(addr.sun_path, ".KasmVNCSock");
|
||||||
addr.sun_path[0] = '\0';
|
addr.sun_path[0] = '\0';
|
||||||
|
|
||||||
|
struct timeval tv;
|
||||||
|
gettimeofday(&tv, NULL);
|
||||||
|
|
||||||
struct sockaddr_un myaddr;
|
struct sockaddr_un myaddr;
|
||||||
myaddr.sun_family = AF_UNIX;
|
myaddr.sun_family = AF_UNIX;
|
||||||
sprintf(myaddr.sun_path, ".%s@%s", ws_ctx->user, ws_ctx->ip);
|
sprintf(myaddr.sun_path, ".%s@%s_%lu.%lu", ws_ctx->user, ws_ctx->ip,
|
||||||
|
tv.tv_sec, tv.tv_usec);
|
||||||
myaddr.sun_path[0] = '\0';
|
myaddr.sun_path[0] = '\0';
|
||||||
|
|
||||||
int tsock = socket(AF_UNIX, SOCK_STREAM, 0);
|
int tsock = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user