Follow-up of !2786, which appears to have been abandoned.
--
v17: ws2_32/tests: Add test for AF_UNIX sockets.
server: Fix getsockname() and accept() on AF_UNIX sockets.
server: Introduce error when attempting to create a SOCK_DGRAM AF_UNIX socket.
server: Allow for deletion of socket files.
https://gitlab.winehq.org/wine/wine/-/merge_requests/7650
Ralf Habacker (@rhabacker) commented about server/fd.c:
> set_error( STATUS_OBJECT_NAME_COLLISION );
> goto error;
> }
> ftruncate( fd->unix_fd, 0 );
Here is a direct usage of the `unix_fd`, which may be a problem.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7650#note_100892
On Tue Apr 15 07:50:06 2025 +0000, Ralf Habacker wrote:
> Here the `unix_fd` is saved for closing the file, which is -1 in the
> case of sockets.
`unix_fd` is used in `inode_close_pending()`, `inode_destroy()`, `inode_add_closed_fd()`, `fd_destroy()` and `unmount_fd()` to close the file. In any of the mentioned location the call to close() is guarded with `if (fd->unix_fd != -1)`, so these function are already save the socket case.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/7650#note_100886