Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ UpdateWithNewSecurityDescriptor()

void System.Security.AccessControl.ObjectSecurity< T >.UpdateWithNewSecurityDescriptor ( RawSecurityDescriptor newOne,
AccessControlSections includeSections )
inlineprivate

Definition at line 198 of file ObjectSecurity.cs.

199 {
200 if ((includeSections & AccessControlSections.Owner) != 0)
201 {
202 _ownerModified = true;
203 _securityDescriptor.Owner = newOne.Owner;
204 }
205 if ((includeSections & AccessControlSections.Group) != 0)
206 {
207 _groupModified = true;
208 _securityDescriptor.Group = newOne.Group;
209 }
210 if ((includeSections & AccessControlSections.Audit) != 0)
211 {
212 _saclModified = true;
213 if (newOne.SystemAcl != null)
214 {
215 _securityDescriptor.SystemAcl = new SystemAcl(IsContainer, IsDS, newOne.SystemAcl, trusted: true);
216 }
217 else
218 {
219 _securityDescriptor.SystemAcl = null;
220 }
221 _securityDescriptor.UpdateControlFlags(ControlFlags.SystemAclPresent | ControlFlags.SystemAclAutoInherited | ControlFlags.SystemAclProtected, newOne.ControlFlags & (ControlFlags.SystemAclPresent | ControlFlags.SystemAclAutoInherited | ControlFlags.SystemAclProtected));
222 }
223 if ((includeSections & AccessControlSections.Access) != 0)
224 {
225 _daclModified = true;
226 if (newOne.DiscretionaryAcl != null)
227 {
228 _securityDescriptor.DiscretionaryAcl = new DiscretionaryAcl(IsContainer, IsDS, newOne.DiscretionaryAcl, trusted: true);
229 }
230 else
231 {
232 _securityDescriptor.DiscretionaryAcl = null;
233 }
234 ControlFlags controlFlags = _securityDescriptor.ControlFlags & ControlFlags.DiscretionaryAclPresent;
235 _securityDescriptor.UpdateControlFlags(ControlFlags.DiscretionaryAclPresent | ControlFlags.DiscretionaryAclAutoInherited | ControlFlags.DiscretionaryAclProtected, (newOne.ControlFlags | controlFlags) & (ControlFlags.DiscretionaryAclPresent | ControlFlags.DiscretionaryAclAutoInherited | ControlFlags.DiscretionaryAclProtected));
236 }
237 }
void UpdateControlFlags(ControlFlags flagsToUpdate, ControlFlags newFlags)
readonly CommonSecurityDescriptor _securityDescriptor

References System.Security.AccessControl.ObjectSecurity< T >._daclModified, System.Security.AccessControl.ObjectSecurity< T >._groupModified, System.Security.AccessControl.ObjectSecurity< T >._ownerModified, System.Security.AccessControl.ObjectSecurity< T >._saclModified, System.Security.AccessControl.ObjectSecurity< T >._securityDescriptor, System.Security.AccessControl.RawSecurityDescriptor.ControlFlags, System.Security.AccessControl.RawSecurityDescriptor.DiscretionaryAcl, System.Security.AccessControl.DiscretionaryAcl, System.Security.AccessControl.RawSecurityDescriptor.Group, System.Security.AccessControl.ObjectSecurity< T >.IsContainer, System.Security.AccessControl.ObjectSecurity< T >.IsDS, System.Security.AccessControl.RawSecurityDescriptor.Owner, System.Security.AccessControl.RawSecurityDescriptor.SystemAcl, System.Security.AccessControl.SystemAcl, and System.Security.AccessControl.CommonSecurityDescriptor.UpdateControlFlags().

Referenced by System.Security.AccessControl.ObjectSecurity< T >.SetSecurityDescriptorBinaryForm(), and System.Security.AccessControl.ObjectSecurity< T >.SetSecurityDescriptorSddlForm().