Dieser Artikel wurde maschinell übersetzt. Wenn Sie die englische Version des Artikels anzeigen möchten, aktivieren Sie das Kontrollkästchen Englisch. Sie können den englischen Text auch in einem Popupfenster anzeigen, indem Sie den Mauszeiger über den Text bewegen.
|
Übersetzung
Englisch
|
MutexSecurity-Klasse
Veröffentlicht: Oktober 2016
Assembly: mscorlib (in mscorlib.dll)
System.Security.AccessControl.ObjectSecurity
System.Security.AccessControl.CommonObjectSecurity
System.Security.AccessControl.NativeObjectSecurity
System.Security.AccessControl.MutexSecurity
Name | Beschreibung | |
---|---|---|
![]() | MutexSecurity() | |
![]() | MutexSecurity(String, AccessControlSections) |
Name | Beschreibung | |
---|---|---|
![]() | AccessRightType | |
![]() | AccessRuleType | |
![]() | AreAccessRulesCanonical | |
![]() | AreAccessRulesProtected | |
![]() | AreAuditRulesCanonical | |
![]() | AreAuditRulesProtected | |
![]() | AuditRuleType |
Name | Beschreibung | |
---|---|---|
![]() | AccessRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AccessControlType) | |
![]() | AddAccessRule(MutexAccessRule) | |
![]() | AddAuditRule(MutexAuditRule) | |
![]() | AuditRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AuditFlags) | |
![]() | Equals(Object) | |
![]() | GetAccessRules(Boolean, Boolean, Type) | |
![]() | GetAuditRules(Boolean, Boolean, Type) | |
![]() | GetGroup(Type) | |
![]() | GetHashCode() | |
![]() | GetOwner(Type) | |
![]() | GetSecurityDescriptorBinaryForm() | |
![]() | GetSecurityDescriptorSddlForm(AccessControlSections) | |
![]() | GetType() | |
![]() | ModifyAccessRule(AccessControlModification, AccessRule, Boolean) | |
![]() | ModifyAuditRule(AccessControlModification, AuditRule, Boolean) | |
![]() | PurgeAccessRules(IdentityReference) | |
![]() | PurgeAuditRules(IdentityReference) | |
![]() | RemoveAccessRule(MutexAccessRule) | |
![]() | RemoveAccessRuleAll(MutexAccessRule) | |
![]() | RemoveAccessRuleSpecific(MutexAccessRule) | |
![]() | RemoveAuditRule(MutexAuditRule) | |
![]() | RemoveAuditRuleAll(MutexAuditRule) | |
![]() | RemoveAuditRuleSpecific(MutexAuditRule) | |
![]() | ResetAccessRule(MutexAccessRule) | |
![]() | SetAccessRule(MutexAccessRule) | |
![]() | SetAccessRuleProtection(Boolean, Boolean) | |
![]() | SetAuditRule(MutexAuditRule) | |
![]() | SetAuditRuleProtection(Boolean, Boolean) | |
![]() | SetGroup(IdentityReference) | |
![]() | SetOwner(IdentityReference) | |
![]() | SetSecurityDescriptorBinaryForm(Byte[]) | |
![]() | SetSecurityDescriptorBinaryForm(Byte[], AccessControlSections) | |
![]() | SetSecurityDescriptorSddlForm(String) | |
![]() | SetSecurityDescriptorSddlForm(String, AccessControlSections) | |
![]() | ToString() |
![]() |
---|
Beim Erstellen einer Sicherheitsbeschreibung mit einem null-DACL. Ein null-Verweis auf eine DACL kann alle Benutzer auf ein Objekt einen Denial-of-Service-Angriff Zugriffsregeln hinzufügen. Ein neues MutexSecurity -Objekt beginnt immer mit einer leeren DACL, wodurch allen Benutzern der Zugriff verweigert wird. Verletzung der die kanonische Reihenfolge der ACEs. Wenn die ACE-Liste in der DACL nicht kanonische Reihenfolge beibehalten wird, können Benutzer versehentlich Zugriff auf das gesicherte Objekt erhalten. Zum Beispiel müssen verweigerte Zugriffsrechte immer vor zulässigen Zugriffsrechten angezeigt. MutexSecurity -Objekte behalten intern die richtige Reihenfolge. Bearbeiten von Security Descriptor Flags, die nur Ressourcen-Manager-gesteuert werden soll. Das Erstellen ungültiger Kombinationen von ACE-Flags. Bearbeiten von geerbten ACEs. Vererbung und Weitergabe erfolgt von der Ressourcen-Manager als Reaktion auf Änderungen, die Sie an Zugriffs-und Überwachungsregeln. Einfügen von bedeutungslosen ACEs in ACLs.
Low-Level-Aufgaben, die normalerweise von den Ressourcen-Manager ausgeführt werden. Hinzufügen oder Entfernen von Zugriffssteuerungseinträgen in Methoden, die die kanonische Reihenfolge nicht beibehalten.
![]() |
---|
![]() |
---|
![]() |
---|
using System; using System.Threading; using System.Security.AccessControl; using System.Security.Principal; public class Example { public static void Main() { // Create a string representing the current user. string user = Environment.UserDomainName + "\\" + Environment.UserName; // Create a security object that grants no access. MutexSecurity mSec = new MutexSecurity(); // Add a rule that grants the current user the // right to enter or release the mutex. MutexAccessRule rule = new MutexAccessRule(user, MutexRights.Synchronize | MutexRights.Modify, AccessControlType.Allow); mSec.AddAccessRule(rule); // Add a rule that denies the current user the // right to change permissions on the mutex. rule = new MutexAccessRule(user, MutexRights.ChangePermissions, AccessControlType.Deny); mSec.AddAccessRule(rule); // Display the rules in the security object. ShowSecurity(mSec); // Add a rule that allows the current user the // right to read permissions on the mutex. This rule // is merged with the existing Allow rule. rule = new MutexAccessRule(user, MutexRights.ReadPermissions, AccessControlType.Allow); mSec.AddAccessRule(rule); ShowSecurity(mSec); } private static void ShowSecurity(MutexSecurity security) { Console.WriteLine("\r\nCurrent access rules:\r\n"); foreach(MutexAccessRule ar in security.GetAccessRules(true, true, typeof(NTAccount))) { Console.WriteLine(" User: {0}", ar.IdentityReference); Console.WriteLine(" Type: {0}", ar.AccessControlType); Console.WriteLine(" Rights: {0}", ar.MutexRights); Console.WriteLine(); } } } /*This code example produces output similar to following: Current access rules: User: TestDomain\TestUser Type: Deny Rights: ChangePermissions User: TestDomain\TestUser Type: Allow Rights: Modify, Synchronize Current access rules: User: TestDomain\TestUser Type: Deny Rights: ChangePermissions User: TestDomain\TestUser Type: Allow Rights: Modify, ReadPermissions, Synchronize */
Verfügbar seit 2.0
Alle öffentlichen statischen Member ( Shared in Visual Basic) dieses Typs sind threadsicher. Die Threadsicherheit für Instanzmember ist nicht garantiert.