Commit Graph
24 Commits
Author SHA1 Message Date
Alexander Köplinger b0032294da [Test] Cleaned up how a bunch of tests were ignored
Previously, many tests just had a return statement when the test shouldn't
be executed (e.g. Unix-only). This made it look like the test was successful
when in fact it wasn't executed at all.
Assert.Ignore() is now used instead to correctly exclude those tests.
2014-02-23 19:44:21 +01:00
Sebastien Pouliot f7882be852 Relax name check when deserializing a WindowsIdentity instance as the name can be empty (e.g. iOS7 simulator will hide the user name) [#12789] 2013-09-30 20:39:14 -04:00
Sebastien Pouliot 1065fe4e2b [ios] Ignore the WindowsIdentityTest.SerializeRoundTrip test on iOS (see #12789) 2013-06-20 09:32:35 -04:00
Marek Safar afa79435aa Update for mobile profile 2013-02-07 16:34:21 +01:00
James Bellinger 9322e0d16b ACLs now work on Windows. Tests all the way up to DirectorySecurityTest and FileSecurityTest.
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.
2012-07-07 18:45:06 -04:00
James Bellinger 2d415e7a8f Implemented all of DiscretionaryAcl except for RemoveAccess. Unit tests are included.
Also fixed:
CommonAcl's merging now filters out AceFlags.InheritedFlags when !IsContainer.
For matching AccessMask, CommonAcl will now correctly merge ContainerInherit and ObjectInherit.
GenericAcl's SyncRoot is now virtual as per spec.
SecurityIdentifier.CompareTo throws ArgumentNullException, not NullReferenceException, on null parameter.

Miscellaneous unit tests:
Verify that RawAcl throws for negative capacity.
2012-07-03 13:56:55 -04:00
James Bellinger 95db8e694e SecurityIdentifier's CompareTo now works like MS.Net. CommonAcl is supposed to sort groupings of canonical ACEs using SecurityIdentifier's CompareTo, so this was important to do.
I determined the behavior of CompareTo by first writing unit tests for
CommonAcl (instantiated as DiscretionaryAcl but using RawAcl instead of
DiscretionaryAcl methods to do the manipulation to keep DiscretionaryAcl
out of the loop). I developed and ran these unit tests on MS.NET using
MonoDevelop...

Anyway, CompareTo appears to compare authority, then the *number* of
subauthorities, and lastly the subauthorities. I'd be curious if there
is more detail, but so far this seems to cover it. It's definitely
*not* just a comparison of the string.

This patch also modifies CommonAcl to take advantage of this new sorting,
so now it should sort groups of explicit ACEs (access deny, access allow)
in canonical ACLs correctly.

With that down, I've got two unit tests that still fail on Mono.
2012-07-02 23:18:25 -04:00
Miguel de Icaza ae0feab435 Removal of NET_1_1 defines and some NET_2_0; Both defines are true these days in Mono, no versions prior to 2.0 are supported 2012-06-01 18:04:24 -04:00
Marek Safar 0c7782ddc4 Convert some old nunit tests 2012-02-27 16:59:01 +00:00
Kenneth Bell c47765e4a2 Implement SecurityIdentifier and improve NTAccount.
* Only translates between SecurityIdentifier and NTAccount for
    well-known accounts.

  * NTAccount changed to not upper-case values to match behaviour
    observed in Microsoft's .NET (see also unit tests)

  * Add unit tests for both classes
2011-01-26 17:59:52 -05:00
Zoltan Varga 7c9418a910 2009-06-24 Zoltan Varga <[email protected]>
* *.cs: Convert all tests to new-style nunit classes/methods.

svn path=/trunk/mcs/; revision=136750
2009-06-24 04:07:02 +00:00
Zoltan Varga bb565391df 2009-02-04 Zoltan Varga <[email protected]>
* GenericIdentityTest.cs GenericPrincipalTest.cs: Make these tests
	quiet.

svn path=/trunk/mcs/; revision=125632
2009-02-04 01:31:11 +00:00
Paolo Molaro 49fa2e3e01 Fixed the tests checking for PlatformID.
svn path=/trunk/mcs/; revision=115657
2008-10-13 14:39:59 +00:00
Sebastien Pouliot 7c6e0a1c60 2006-08-08 Sebastien Pouliot <[email protected]>
* GenericIdentityTest.cs: Added serialization test cases.
	* GenericPrincipalTest.cs: Added serialization test cases.


svn path=/trunk/mcs/; revision=63477
2006-08-08 12:26:13 +00:00
Sebastien Pouliot 4329d74aac 2005-08-30 Sebastien Pouliot <[email protected]>
* GenericPrincipalTest.cs: Roles are case insensitive.


svn path=/trunk/mcs/; revision=49130
2005-08-30 14:39:03 +00:00
Sebastien Pouliot f227d2acf6 2005-06-17 Sebastien Pouliot <[email protected]>
* WindowsPrincipalTest.cs: In NET_2_0 multiple IsInRole methods can 
	now accept null.


svn path=/trunk/mcs/; revision=46130
2005-06-17 11:04:21 +00:00
Raja R Harinath e0cfa4925e Set svn:eol-style=native, delete svn:executable.
Fix line endings of System/Decimal.cs (only actual "change" in text, to force recompile of mscorlib to reflect changes in decimal constant handling in the compiler)


svn path=/trunk/mcs/; revision=44558
2005-05-16 12:23:26 +00:00
Sebastien Pouliot 24de554847 Check platform without using #define
svn path=/trunk/mcs/; revision=44296
2005-05-09 19:56:14 +00:00
Sebastien Pouliot b31593a311 2005-05-09 Sebastien Pouliot <[email protected]>
* WindowsIdentityTest.cs: Fixed IsPosix for NET_2_0.


svn path=/trunk/mcs/; revision=44274
2005-05-09 13:11:16 +00:00
Sebastien Pouliot 5d3bf03878 2004-04-20 Sebastien Pouliot <[email protected]>
* WindowsIdentityTest.cs: Don't fail on Windows for some contructor
	tests (in NET_1_1). Checking for Windows 2003 Server isn't enough as
	the domain must also be Windows 2003 Server based to work. Also skip
	the GetRolesViaReflection when running os POSIX systems.

svn path=/trunk/mcs/; revision=25716
2004-04-20 11:37:48 +00:00
Sebastien Pouliot 25a55bf367 2004-04-14 Sebastien Pouliot <[email protected]>
* WindowsIdentityTest.cs: Added reflection and serialization tests.

svn path=/trunk/mcs/; revision=25467
2004-04-14 12:47:09 +00:00
Sebastien Pouliot bce4c4355b 2004-04-13 Sebastien Pouliot <[email protected]>
* WindowsIdentityTest.cs: Adjusted unit tests to run on both Windows
	and Linux (or any POSIX compliant OS).
	* WindowsPrincipalTest.cs: Removed [Ignore] from some tests.

svn path=/trunk/mcs/; revision=25398
2004-04-13 13:41:34 +00:00
Sebastien Pouliot ef13b3da61 2003-12-29 Sebastien Pouliot <[email protected]>
* WindowsIdentityTest.cs: New. Partial unit test for WindowsIdentity.
	* WindowsPrincipalTest.cs: New. Partial unit test for WindowsPrincipal.

svn path=/trunk/mcs/; revision=21545
2003-12-30 04:16:32 +00:00
Sebastien Pouliot a7fd2bc8bc 2003-07-01 Sebastien Pouliot <[email protected]>
* GenericIdentityTest.cs: New. Complete unit test.
	* GenericPrincipalTest.cs: New. Complete unit test.
	* ChangeLog: New.

svn path=/trunk/mcs/; revision=15837
2003-07-01 23:04:38 +00:00