tests: log a too-long Unix socket path in sws and socksd

Ref: #10919
This commit is contained in:
Dan Fandrich 2023-04-11 10:07:30 -07:00
parent a8fbdb461c
commit dc18b40b40
2 changed files with 5 additions and 4 deletions

View File

@ -1017,8 +1017,8 @@ int main(int argc, char *argv[])
unix_socket = argv[arg];
if(strlen(unix_socket) >= sizeof(sau.sun_path)) {
fprintf(stderr,
"socksd: socket path must be shorter than %zu chars\n",
sizeof(sau.sun_path));
"socksd: socket path must be shorter than %zu chars: %s\n",
sizeof(sau.sun_path), unix_socket);
return 0;
}
socket_domain = AF_UNIX;

View File

@ -2030,8 +2030,9 @@ int main(int argc, char *argv[])
#ifdef USE_UNIX_SOCKETS
unix_socket = argv[arg];
if(strlen(unix_socket) >= sizeof(me.sau.sun_path)) {
fprintf(stderr, "sws: socket path must be shorter than %zu chars\n",
sizeof(me.sau.sun_path));
fprintf(stderr,
"sws: socket path must be shorter than %zu chars: %s\n",
sizeof(me.sau.sun_path), unix_socket);
return 0;
}
socket_type = "unix";