/// <summary> /// Add mandatory integrity label to SACL /// </summary> /// <param name="level">The integrity level</param> /// <param name="flags">The ACE flags.</param> /// <param name="policy">The mandatory label policy</param> public void AddMandatoryLabel(TokenIntegrityLevel level, AceFlags flags, MandatoryLabelPolicy policy) { AddMandatoryLabel(NtSecurity.GetIntegritySid(level), flags, policy); }
/// <summary> /// Add mandatory integrity label to SACL /// </summary> /// <param name="label">The integrity label SID</param> /// <param name="flags">The ACE flags.</param> /// <param name="policy">The mandatory label policy</param> public void AddMandatoryLabel(Sid label, AceFlags flags, MandatoryLabelPolicy policy) { MandatoryLabel = new Ace(AceType.MandatoryLabel, flags, policy, label); }
/// <summary> /// Add mandatory integrity label to SACL /// </summary> /// <param name="label">The integrity label SID</param> /// <param name="flags">The ACE flags.</param> /// <param name="policy">The mandatory label policy</param> public void AddMandatoryLabel(Sid label, AceFlags flags, MandatoryLabelPolicy policy) { if (Sacl == null) { Sacl = new Acl(); } Sacl.NullAcl = false; Sacl.Add(new Ace(AceType.MandatoryLabel, flags, (uint)policy, label)); }
protected NtTypeFactoryImplBase(bool can_open, MandatoryLabelPolicy default_policy) : base(can_open, default_policy) { }
protected NtTypeFactoryImplBase(Type container_access_rights_type, bool can_open, MandatoryLabelPolicy default_policy) : base(container_access_rights_type, can_open, default_policy) { }
internal NtTypeFactory(Type access_rights_type, Type container_access_rights_type, Type object_type, bool can_open, MandatoryLabelPolicy default_policy) { AccessRightsType = access_rights_type; ContainerAccessRightsType = container_access_rights_type; ObjectType = object_type; CanOpen = can_open; DefaultMandatoryPolicy = default_policy; }
protected NtTypeFactoryImplBase(bool can_open, MandatoryLabelPolicy default_policy) : this(typeof(A), can_open, default_policy) { }
internal NtType(string name, GenericMapping generic_mapping, Type access_rights_type, Type container_access_rights_type, MandatoryLabelPolicy default_policy) { if (!access_rights_type.IsEnum) { throw new ArgumentException("Specify an enumerated type", "access_rights_type"); } _type_factory = new NtTypeFactory(access_rights_type, container_access_rights_type, typeof(object), false, default_policy); Name = name; ValidAccess = CalculateValidAccess(access_rights_type) | CalculateValidAccess(container_access_rights_type); GenericMapping = generic_mapping; GenericRead = NtSecurity.AccessMaskToString(GenericMapping.GenericRead, access_rights_type); GenericWrite = NtSecurity.AccessMaskToString(GenericMapping.GenericWrite, access_rights_type); GenericExecute = NtSecurity.AccessMaskToString(GenericMapping.GenericExecute, access_rights_type); GenericAll = NtSecurity.AccessMaskToString(GenericMapping.GenericAll, access_rights_type); DefaultMandatoryAccess = NtSecurity.AccessMaskToString(GetDefaultMandatoryAccess(), access_rights_type); }