mirror of
https://github.com/curl/curl.git
synced 2026-06-18 08:35:37 +03:00
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:
parent
8cc3fed7df
commit
0882e3951d
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue