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.
* 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
* DirectoryInfo.cs, FileInfo.cs: Moonlight needs the default ctor
to decorate them with [SecuritySafeCritical] for corclr
inheritance rules
svn path=/trunk/mcs/; revision=154364
* Directory.cs, DirectoryInfo.cs: Disble new NET_4_0 API used in
SL4 until we have elevated trust working correctly (since they
are *not* decorated as [SecurityCritical])
svn path=/trunk/mcs/; revision=153968
* Directory.cs: Don't expose SearchOption in NET_2_1
* DirectoryInfo.cs: Don't expose SearchOption in NET_2_1
* MonoIO.cs: Don't throw a DriveNotFoundException under NET_2_1 -
an IOExpection will be thrown (like the 1.x profile)
svn path=/trunk/mcs/; revision=142479
indicates whether the original path should only container the last
part of the directory. Moved logic for determining the Name and
Parent to Initialize method, to allow it to be re-used on
deserialization. Renamed argument names to fix corcompare issues.
Added missing argument checks.
* Directory.cs (CreateDirectoriesInternal): Use internal ctor for
DirectoryInfo to ensure OriginalPath only contains last part of
the directory.
* File.cs: Removed redundant checks from Create. On 2.0 profile, pass
FileOptions to FileStream. Removed redundant directory check from
Delete and modified exceptions to more closely match MS.
* FileInfo.cs: Added argument check to ctor to match MS. Added missing
deserialization ctor. Modified argument checks in MoveTo, and removed
redundant checks. Added missing argument checks in CopyTo. Code
formatting.
* FileSystemInfo.cs: Modified argument checks in CheckPath to more
closely match MS.
* MonoIO.cs: Added msg that does not disclose filename for
ERROR_FILE_EXISTS.
* Path.cs: Use String.Length instead of comparing with String.Empty.
Removed exceptions argument names to match MS.
* File.cs: Added/improved tests for Create and Move.
* DirectoryInfoTest.cs: No longer derive from deprecated Assertion
class. Improved tests for ctor, Create, Name, Parent, ...
* FileInfoTest.cs: No longer derive from deprecated Assertion class.
Improved/added tests,
* PathTest.cs: Added tests for IsPathRooted and GetFullPath.
* FileSystemInfoTest.cs: Fixed test. Now passes on both Mono and MS.
svn path=/trunk/mcs/; revision=101006
* DirectoryInfo.cs: Throw a better exception (accorind go the
docs, UnauthorizedAccessException is thrown if the underlying
platform does not support it and *also* if there are no
permissions to access it, which is more convenient than the
PlatformNotSupportedException that only states that it needs Win2k
or newer).
svn path=/trunk/mcs/; revision=71457
* DirectoryInfo.cs (GetFiles): Implement option with SearchOptions
== AllDirectories
And a lot of MonoTODOs updated as well
svn path=/trunk/mcs/; revision=67998
* DirectoryInfo.cs : on Windows top directory is something like c:\.
* DirectoryInfoTest.cs : don't expect "/" as a top directory on
Windows.
svn path=/trunk/mcs/; revision=55707
* DirectoryInfo.cs: Fixed#76903 where the Name property wasn't
correct in some cases. Added special case for Windows drives. Reduced
temporary allocations in Get* methods (removed ArrayList). Added some
new 2.0 methods (partial).
* MonoIO.cs: Removed InvalidPathChars icall as the return value is
different from 1.x and 2.0. The values are now defined in Path.cs.
* Path.cs: Fixed#76191 so that GetFullPath on a Windows drive returns
the current directory (if it's on the specified drive). Fixed 2.0 API
changes (e.g. static class).
* SearchOption.cs: Added missing [Serializable] (2.0).
svn path=/trunk/mcs/; revision=54456
* FileSystemInfo.cs: Fixed exception arguments. Added ComVisible for
NET_2_0.
* DirectoryInfo.cs: Fixed bug #75443 when the directory ends with a
separator. Added ComVisible for NET_2_0. Normalized line endings.
svn path=/trunk/mcs/; revision=46879
* FileInfo.cs: Reformat the whole file to use DOS line endings.
(MoveTo): Return if the destination of Move is the same as the file's
current location.
svn path=/trunk/mcs/; revision=27996
* DirectoryInfo.cs: fixed bug #42991.
* Path.cs:
(CanonicalizePath): store the value of the trimmed input string. Make it
work with paths such as "/home/xxx/.".
svn path=/trunk/mcs/; revision=14585
* BufferedStream.cs:
- Removed unusefull code.
- Added ObjectDisposedException to Position
- Dont flush if stream is allready closed.
- Flush throws also ObjectDisposedException.
* Directory.cs:
- GetFileSystemEtries: ArgumentNullException if pattern is null
* DirectoryInfo.cs: Fixed little MoveTo () bug.
* FileInfo.cs:
- Exists: If file does not exists when instance is created the
value of the Exists property does not change even if file is created
afterwards.
- Delete: If path is a directory UnauthorizedException is thrown.
- CopyTo: Now we can overwrite file if wanted.
* Path.cs:
- GetFullPath: Now throws exception when path is " ".
svn path=/trunk/mcs/; revision=14370
* DirectoryInfo.cs: changed ToString to match MS behavior.
* Path.cs: further fixes to GetDirectoryName to return null in the
same cases that MS does.
Fixes bug #38387.
svn path=/trunk/mcs/; revision=12105