NativeObjectSecurity is implemented.
I've done it in such a way that, for OSes that do not have a unified API for all ACLs,
overrides can be done in subclasses such as FileSystemSecurity without trouble.
ObjectSecurity, CommonObjectSecurity, and DirectoryObjectSecurity all implemented.
MutexSecurity, PipeSecurity, etc. all just add type specialization and nothing else. Implemented all of these as well.
Access and Audit rules now correctly use NTAccount in their string overloads (see unit tests).
The constructors all provide correct AccessMasks now. In other words, these classes are all now un-broken/no longer stubs.
More unit tests for CommonSecurityDescriptor and fixes to pass them.
A few had checks that were redundant (implemented by (Authorization|Audit|Access)Rule) as well. These have been removed.
The Allow Everyone Full Access default for null DiscretionaryAcls in CommonSecurityDescriptor is, I think,
properly implemented. This required some changes to GenericSecurityDescriptor as well, but now Mono matches
MS.NET on GetSddl/GetBinaryForm for null DiscretionaryAcl including roundtrip.
What's still missing:
(1) CommonAcl's RemoveAccess/RemoveAudit. RemoveAll and RemoveSpecific work so it's not a big issue.
(2) CommonAcl merging will not yet try to merge a CommonAce together with an ObjectAce.
(3) The various *Security constructors. Get/SetAccessControl work on files and directories.
However, you still have to create and then set. I am not too familiar with Mono runtime internal
calls, but to someone who is: If the SECURITY_ATTRIBUTES parameter to Create*'s lpSecurityDescriptor
pointed to the output of GenericSecurityDescriptor's GetBinaryForm, that would be a complete
implementation.
* FileStream.cs: when running on Windows and a path with Unix
directory separator chars is passed (including an UNC share), get
the canonical form of the path before attempting to retrieve its
directory name. Fixes bug #607502
* Path.cs: typo fix
svn path=/trunk/mcs/; revision=157650
* Directory.cs: Ensure elevated trust when calling on
Moonlight.
* DirectoryInfo.cs: Ensure elevated trust when calling a .ctor
on Moonlight.
* File.cs: Ensure elevated trust when calling a .ctor on
Moonlight.
* FileInfo.cs: Ensure elevated trust when calling a .ctor on
Moonlight.
* FileStream.cs: Ensure elevated trust when calling a .ctor on
Moonlight. Name property returns "[Unknown]" unless a Moonlight
application is executed with elevated trust.
* Path.cs: Ensure elevated trust when calling a GetTempPath,
GetTempFileName or GetFullPath on Moonlight. Add a shared
internal method to validate paths to reduce code duplication.
svn path=/trunk/mcs/; revision=155643
* StreamWriter.cs:
* FileStream.cs: if flushing fails when disposing the stream, make
sure it is closed before throwing the exception. Fixes bug #579146.
svn path=/trunk/mcs/; revision=151761
* UnmanagedMemoryStream.cs: Move the CLS attribute to the methods
that are unsafe.
* Path.cs (Combine):e Fix implementation to follow docs (we need
to reset the path if any of the combined paths is rooted), and add a
couple of overloads;
* FileStream.cs (Flush/flushToDisk): Implement.
* Stream.cs (CopyTo): Implement.
svn path=/trunk/mcs/; revision=145640
* FileStream.cs: Check the return value of MonoIO.Write and handle
short-writes as those can happen when a FileStream is used on top
of a pipe on Unix.
Fixes bug: #531613, this should be backported to 2-4 and 2-6 after
some testing.
svn path=/trunk/mcs/; revision=145271
* FileStream.cs: Move code to deal with 'anonymous' filenames
into two methods (returning the path, fullpath or only the
filename). Default Moonlight to anonymous (not only for isolated
storage) unless the coreclr is disable (e.g. smcs)
svn path=/trunk/mcs/; revision=144945
* ConsoleTest.cs: added a bunch of tests for the standard input,
output and error stream properties.
2009-03-23 Marek Habersack <[email protected]>
* FileStreamTest.cs: added a bunch of tests for SafeFileHandle
constructors
2009-03-23 Marek Habersack <[email protected]>
* Console.cs: OpenStandard{Input,Output,Error} no longer use
FileStream on 2.0+. The reason is that SafeFileHandle used in the
stream doesn't allow handles with values <= 0, and on Unix stdin
is 0 which would break the Console class. Instead of FileStream,
introduced a simple internal specialized stream which is used in
this scenario.
2009-03-23 Marek Habersack <[email protected]>
* FileStream.cs: implemented full support for SafeFileHandle in
2.0. The obsolete constructors taking an IntPtr now wrap it in a
SafeFileHandle.
2009-03-23 Marek Habersack <[email protected]>
* SafeHandle.cs: added an internal property, OwnsHandle, used by
FileStream.
svn path=/trunk/mcs/; revision=130049
* FileStream.cs: Found while debugging webcompare, we should add
Obsoletes to the FileStream constructors that take IntPtrs.
svn path=/trunk/mcs/; revision=121916
* FileStream.cs, MonoIO.cs: For Silverlight 2.0 (NET_2_1) we always
throw IsolatedStorageException instead of FileNotFoundException and
DirectoryNotFoundException.
svn path=/trunk/mcs/; revision=111391
* FileStream.cs: Adjust exception being thrown for Silverlight 2.0.
* FileSystemInfo.cs: In Silverlight 2 this type does not inherit from
MarshalByRefObject nor does it implement ISerializable.
* Stream.cs: In Silverlight 2 this type does not inherit from
MarshalByRefObject.
* TextReader.cs: In Silverlight 2 this type does not inherit from
MarshalByRefObject.
* TextWriter.cs: In Silverlight 2 this type does not inherit from
MarshalByRefObject.
* UnmanagedMemoryStream.cs: For Silverlight 2 add CLSCompliant(false)
to the PositionPointer property.
svn path=/trunk/mcs/; revision=111271
* FileStream.cs: Respect request for buffering in all cases.
Gonzalo added code in r42667 that disables buffering even when it is
requested, in the case that ftype != MonoFileType.Disk. This was
killing performance for users who do Console.OpenStandardOutput(1024)
but were ending up with a non-buffered FileStream.
The new behaviour appears correct but we should watch for any
regressions.
svn path=/trunk/mcs/; revision=76038
in anonymous mode.
* FileStreamTest.cs: Added and improved tests to verify whether the
reported exceptions match that of MS.
svn path=/trunk/mcs/; revision=72048