예제 #1
0
 /// <summary>
 /// Constructor from a token default DACL and ownership values.
 /// </summary>
 /// <param name="token">The token to use for its default DACL</param>
 public SecurityDescriptor(NtToken token) : this()
 {
     Owner = new SecurityDescriptorSid(token.Owner, true);
     Group = new SecurityDescriptorSid(token.PrimaryGroup, true);
     Dacl  = token.DefaultDacl;
     if (token.IntegrityLevel < TokenIntegrityLevel.Medium)
     {
         Sacl = new Acl();
         Sacl.Add(new Ace(AceType.MandatoryLabel, AceFlags.None, 1, token.IntegrityLevelSid.Sid));
     }
 }
 /// <summary>
 /// Constructor from a token default DACL and ownership values.
 /// </summary>
 /// <param name="token">The token to use for its default DACL</param>
 public SecurityDescriptor(NtToken token) : this()
 {
     Owner = new SecurityDescriptorSid(token.Owner, true);
     Group = new SecurityDescriptorSid(token.PrimaryGroup, true);
     Dacl = token.DefaultDalc;
     if (token.IntegrityLevel< TokenIntegrityLevel.Medium)
     {
         Sacl = new Acl();
         Sacl.Add(new Ace(AceType.MandatoryLabel, AceFlags.None, 1, token.IntegrityLevelSid.Sid));
     }
 }