From: Ally Sommers dropbear.sh@gmail.com
--- server/fd.c | 2 +- server/sock.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/server/fd.c b/server/fd.c index 582249d368c..4734b1a551e 100644 --- a/server/fd.c +++ b/server/fd.c @@ -2015,9 +2015,9 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
fd->nt_name = dup_nt_name( root, nt_name, &fd->nt_namelen ); fd->unix_name = NULL; - /* st was set from the file name if the file could not be opened */ if (fd->unix_fd != -1) fstat( fd->unix_fd, &st ); + /* st was set from the file name in case of sockets */ *mode = st.st_mode;
/* only bother with an inode for normal files and directories */ diff --git a/server/sock.c b/server/sock.c index c3727b51d65..9c4aec16d84 100644 --- a/server/sock.c +++ b/server/sock.c @@ -1955,6 +1955,12 @@ static int init_socket( struct sock *sock, int family, int type, int protocol ) return -1; }
+ if (unix_family == AF_UNIX && unix_type == SOCK_DGRAM) + { + set_win32_error(WSAEAFNOSUPPORT); + return -1; + } + sockfd = socket( unix_family, unix_type, unix_protocol );
#ifdef linux