servers: mask to S_IFMT in unix socket path attribute check

Instead of `S_IFSOCK` before this patch. For correctness; it is probably
not an issue in most environments.

Spotted by Copilot
Bug: https://github.com/curl/curl/pull/22021#discussion_r3413049506
Follow-up to 99fb36797a

Closes #22026
This commit is contained in:
Viktor Szakats 2026-06-15 14:03:07 +02:00
parent 8cc3fed7df
commit 0882e3951d
No known key found for this signature in database

View file

@ -701,7 +701,7 @@ int bind_unix_socket(curl_socket_t sock, const char *unix_socket,
errno, curlx_strerror(errno, errbuf, sizeof(errbuf)));
return -1;
}
if((statbuf.st_mode & S_IFSOCK) != S_IFSOCK) {
if((statbuf.st_mode & S_IFMT) != S_IFSOCK) {
logmsg("Error binding socket, %s is not a socket", unix_socket);
return -1;
}