コード例 #1
0
        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());
        }
コード例 #2
0
 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");
     }
 }
コード例 #3
0
ファイル: ADActiveObject.cs プロジェクト: nickchal/pash
		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");
			}
		}
コード例 #4
0
 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);
     }
 }
コード例 #5
0
 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");
     }
 }
コード例 #6
0
ファイル: ADActiveObject.cs プロジェクト: nickchal/pash
		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");
			}
		}
コード例 #7
0
 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);
         }
     }
 }
コード例 #8
0
 public ActiveDirectorySecurity()
 {
     this.securityMaskUsedInRetrieval = SecurityMasks.Owner | SecurityMasks.Group | SecurityMasks.Dacl | SecurityMasks.Sacl;
 }
コード例 #9
0
 internal ActiveDirectorySecurity(byte[] sdBinaryForm, SecurityMasks securityMask)
     : base(new CommonSecurityDescriptor(true, true, sdBinaryForm, 0))
 {
     _securityMaskUsedInRetrieval = securityMask;
 }
コード例 #10
0
ファイル: DirectoryControl.cs プロジェクト: davzucky/corefx
 public SecurityDescriptorFlagControl(SecurityMasks masks) : this()
 {
     SecurityMasks = masks;
 }
コード例 #11
0
		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;
		}
コード例 #12
0
		public ActiveDirectorySecurity()
		{
			this.securityMaskUsedInRetrieval = SecurityMasks.Owner | SecurityMasks.Group | SecurityMasks.Dacl | SecurityMasks.Sacl;
		}
 public SecurityDescriptorFlagControl(SecurityMasks masks)
 {
 }
コード例 #14
0
 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;
 }
コード例 #15
0
		public SecurityDescriptorFlagControl(SecurityMasks masks) : this()
		{
			this.SecurityMasks = masks;
		}
コード例 #16
0
ファイル: ADObjectSearcher.cs プロジェクト: nickchal/pash
		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);
				}
			}
		}
コード例 #17
0
 internal ActiveDirectorySecurity(byte[] sdBinaryForm, SecurityMasks securityMask)
     : base(new CommonSecurityDescriptor(true, true, sdBinaryForm, 0))
 {
     _securityMaskUsedInRetrieval = securityMask;
 }
コード例 #18
0
 public SecurityDescriptorFlagControl(SecurityMasks masks)
 {
 }