Merge pull request #439 from mono-soc-2012/garyb/iconfix
[mono.git] / mcs / class / System.Core / System.IO.Pipes / PipeStream.cs
index 129b910be6d3dd6cb83559b9df4ce70bde7f9f95..fd4a57a693063f4b21c28f755bd953d42089206b 100644 (file)
@@ -132,7 +132,9 @@ namespace System.IO.Pipes
                                if (!IsConnected)
                                        throw new InvalidOperationException ("Pipe is not connected");
                                if (stream == null)
-                                       stream = new FileStream (handle.DangerousGetHandle (), CanRead ? (CanWrite ? FileAccess.ReadWrite : FileAccess.Read) : FileAccess.Write, true, buffer_size, IsAsync);
+                                       stream = new FileStream (handle.DangerousGetHandle (),
+                                                                CanRead ? (CanWrite ? FileAccess.ReadWrite : FileAccess.Read)
+                                                                        : FileAccess.Write, true, buffer_size, IsAsync);
                                return stream;
                        }
                        set { stream = value; }
@@ -193,7 +195,7 @@ namespace System.IO.Pipes
                protected internal void CheckWriteOperations ()
                {
                        if (!IsConnected)
-                               throw new InvalidOperationException ("Pipe us not connected");
+                               throw new InvalidOperationException ("Pipe is not connected");
                        if (!CanWrite)
                                throw new NotSupportedException ("The pipe stream does not support write operations");
                }
@@ -232,16 +234,20 @@ namespace System.IO.Pipes
                        throw new NotSupportedException ();
                }
 
-               [MonoNotSupported ("ACL is not supported in Mono")]
                public PipeSecurity GetAccessControl ()
                {
-                       throw ThrowACLException ();
+                       return new PipeSecurity (SafePipeHandle,
+                                                AccessControlSections.Owner |
+                                                AccessControlSections.Group |
+                                                AccessControlSections.Access);
                }
 
-               [MonoNotSupported ("ACL is not supported in Mono")]
                public void SetAccessControl (PipeSecurity pipeSecurity)
                {
-                       throw ThrowACLException ();
+                       if (pipeSecurity == null)
+                               throw new ArgumentNullException ("pipeSecurity");
+                               
+                       pipeSecurity.Persist (SafePipeHandle);
                }
 
                // pipe I/O