public void Ctor_Flags(SecurityMasks masks, byte[] expectedValue) { var control = new SecurityDescriptorFlagControl(masks); Assert.True(control.IsCritical); Assert.Equal(masks, control.SecurityMasks); Assert.True(control.ServerSide); Assert.Equal("1.2.840.113556.1.4.801", control.Type); Assert.Equal(expectedValue, control.GetValue()); }
public ADActiveObject(ADSessionInfo sessionInfo, ADObject obj) { this._sdFlags = SecurityMasks.Dacl; if (obj != null) { this._adSession = ADSession.ConstructSession(sessionInfo); this._adObject = obj; return; } else { DebugLogger.LogWarning("ADActiveObject", "Constructor(ADSessionInfo,ADObject) called with null obj"); throw new ArgumentNullException("obj"); } }
private ActiveDirectorySecurity GetObjectSecurityFromCache() { try { if (!this.JustCreated) { SecurityMasks securityMasks = this.Options.SecurityMasks; this.RefreshCache(new string[] { securityDescriptorProperty }); if (!(this.NativeObject is System.DirectoryServices.Interop.UnsafeNativeMethods.IAdsPropertyList)) { throw new NotSupportedException(Res.GetString("DSPropertyListUnsupported")); } System.DirectoryServices.Interop.UnsafeNativeMethods.IAdsPropertyList nativeObject = (System.DirectoryServices.Interop.UnsafeNativeMethods.IAdsPropertyList) this.NativeObject; System.DirectoryServices.Interop.UnsafeNativeMethods.IAdsPropertyEntry propertyItem = (System.DirectoryServices.Interop.UnsafeNativeMethods.IAdsPropertyEntry)nativeObject.GetPropertyItem(securityDescriptorProperty, 8); GC.KeepAlive(this); object[] values = (object[])propertyItem.Values; if (values.Length < 1) { throw new InvalidOperationException(Res.GetString("DSSDNoValues")); } if (values.Length > 1) { throw new NotSupportedException(Res.GetString("DSMultipleSDNotSupported")); } System.DirectoryServices.Interop.UnsafeNativeMethods.IAdsPropertyValue value2 = (System.DirectoryServices.Interop.UnsafeNativeMethods.IAdsPropertyValue)values[0]; return(new ActiveDirectorySecurity((byte[])value2.OctetString, securityMasks)); } return(null); } catch (COMException exception) { if (exception.ErrorCode != -2147463155) { throw; } return(null); } }
private ADActiveObject(ADSession session, ADObject obj) { this._sdFlags = SecurityMasks.Dacl; if (obj != null) { if (session != null) { this._adObject = obj; this._adSession = session; return; } else { DebugLogger.LogWarning("ADActiveObject", "Constructor(ADSession,ADObject) called with null session"); throw new ArgumentNullException("session"); } } else { DebugLogger.LogWarning("ADActiveObject", "Constructor(ADSession,ADObject) called with null obj"); throw new ArgumentNullException("obj"); } }
public ADObjectSearcher(ADSessionInfo sessionInfo, ADObject obj) { this._searchScope = ADSearchScope.Subtree; this._filter = ADOPathUtil.CreateFilterClause(ADOperator.Like, "objectClass", "*"); this._propertyList = new List <string>(ADObject.DefaultProperties); this._timeLimit = TimeSpan.Zero; this._schemaTranslationEnabled = true; this._pageSize = 0x100; this._searchOption = null; this._autoRangeRetrieve = true; this._sdFlags = SecurityMasks.Owner | SecurityMasks.Group | SecurityMasks.Dacl; if (sessionInfo == null) { if (obj == null) { this._adSession = ADSession.ConstructSession(null); } else { this._adSession = ADSession.ConstructSession(obj.SessionInfo); } } else { this._adSession = ADSession.ConstructSession(sessionInfo); } if (obj != null) { this._adObject = obj; this._searchRoot = this._adObject.DistinguishedName; foreach (string propertyName in this._adObject.PropertyNames) { this._propertyList.Add(propertyName); } } }
public ActiveDirectorySecurity() { this.securityMaskUsedInRetrieval = SecurityMasks.Owner | SecurityMasks.Group | SecurityMasks.Dacl | SecurityMasks.Sacl; }
internal ActiveDirectorySecurity(byte[] sdBinaryForm, SecurityMasks securityMask) : base(new CommonSecurityDescriptor(true, true, sdBinaryForm, 0)) { _securityMaskUsedInRetrieval = securityMask; }
public SecurityDescriptorFlagControl(SecurityMasks masks) : this() { SecurityMasks = masks; }
internal ActiveDirectorySecurity(byte[] sdBinaryForm, SecurityMasks securityMask) : base(new CommonSecurityDescriptor(true, true, sdBinaryForm, 0)) { this.securityMaskUsedInRetrieval = SecurityMasks.Owner | SecurityMasks.Group | SecurityMasks.Dacl | SecurityMasks.Sacl; this.securityMaskUsedInRetrieval = securityMask; }
public SecurityDescriptorFlagControl(SecurityMasks masks) { }
public SecurityDescriptorFlagControl(SecurityMasks masks) : this() { this.SecurityMasks = masks; }
public ADObjectSearcher(ADSessionInfo sessionInfo, ADObject obj) { this._searchScope = ADSearchScope.Subtree; this._filter = ADOPathUtil.CreateFilterClause(ADOperator.Like, "objectClass", "*"); this._propertyList = new List<string>(ADObject.DefaultProperties); this._timeLimit = TimeSpan.Zero; this._schemaTranslationEnabled = true; this._pageSize = 0x100; this._searchOption = null; this._autoRangeRetrieve = true; this._sdFlags = SecurityMasks.Owner | SecurityMasks.Group | SecurityMasks.Dacl; if (sessionInfo == null) { if (obj == null) { this._adSession = ADSession.ConstructSession(null); } else { this._adSession = ADSession.ConstructSession(obj.SessionInfo); } } else { this._adSession = ADSession.ConstructSession(sessionInfo); } if (obj != null) { this._adObject = obj; this._searchRoot = this._adObject.DistinguishedName; foreach (string propertyName in this._adObject.PropertyNames) { this._propertyList.Add(propertyName); } } }