From ce07be62f2bdd501847c563b17ef8b807e858fe9 Mon Sep 17 00:00:00 2001 From: Gonzalo Paniagua Javier Date: Tue, 22 Feb 2005 22:34:53 +0000 Subject: 2005-02-22 Gonzalo Paniagua Javier * UnixEndPoint.cs: get the correct bytes when building the filename from a SocketAddress. Fixes bug #72850. svn path=/trunk/mcs/; revision=41068 --- mcs/class/Mono.Posix/Mono.Posix/ChangeLog | 5 +++++ mcs/class/Mono.Posix/Mono.Posix/UnixEndPoint.cs | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/mcs/class/Mono.Posix/Mono.Posix/ChangeLog b/mcs/class/Mono.Posix/Mono.Posix/ChangeLog index 3a06f8b4432..3db0296ec37 100644 --- a/mcs/class/Mono.Posix/Mono.Posix/ChangeLog +++ b/mcs/class/Mono.Posix/Mono.Posix/ChangeLog @@ -1,3 +1,8 @@ +2005-02-22 Gonzalo Paniagua Javier + + * UnixEndPoint.cs: get the correct bytes when building the filename from + a SocketAddress. Fixes bug #72850. + 2004-12-30 Jonathan Pryor * Syscall.cs: Add [Obsolete] to Syscall, letting users know they should diff --git a/mcs/class/Mono.Posix/Mono.Posix/UnixEndPoint.cs b/mcs/class/Mono.Posix/Mono.Posix/UnixEndPoint.cs index ecdd01a5822..6d811c84da4 100644 --- a/mcs/class/Mono.Posix/Mono.Posix/UnixEndPoint.cs +++ b/mcs/class/Mono.Posix/Mono.Posix/UnixEndPoint.cs @@ -61,7 +61,18 @@ namespace Mono.Posix { int size = socketAddress.Size; byte [] bytes = new byte [size]; - for (int i = 0; i < size; i++) { + /* + * Should also check this + * + int addr = (int) AddressFamily.Unix; + if (socketAddress [0] != (addr & 0xFF)) + throw new ArgumentException ("socketAddress is not a unix socket address."); + + if (socketAddress [1] != ((addr & 0xFF00) >> 8)) + throw new ArgumentException ("socketAddress is not a unix socket address."); + */ + + for (int i = 2; i < size - 2; i++) { bytes [i] = socketAddress [i]; } -- cgit v1.2.3