Update() private method

private Update ( PermissionSetTriple currentTriple, FrameSecurityDescriptor fsd ) : bool
currentTriple PermissionSetTriple
fsd FrameSecurityDescriptor
return bool
示例#1
0
        internal static PermissionListSet CreateCompressedState(IntPtr unmanagedDCS, out bool bHaltConstruction)
        {
            PermissionSet       set2;
            PermissionSet       set3;
            PermissionListSet   set           = new PermissionListSet();
            PermissionSetTriple currentTriple = new PermissionSetTriple();
            int descCount = DomainCompressedStack.GetDescCount(unmanagedDCS);

            bHaltConstruction = false;
            for (int i = 0; (i < descCount) && !bHaltConstruction; i++)
            {
                FrameSecurityDescriptor descriptor;
                Assembly assembly;
                if (DomainCompressedStack.GetDescriptorInfo(unmanagedDCS, i, out set2, out set3, out assembly, out descriptor))
                {
                    bHaltConstruction = set.Update(currentTriple, descriptor);
                }
                else
                {
                    set.Update(currentTriple, set2, set3);
                }
            }
            if (!bHaltConstruction && !DomainCompressedStack.IgnoreDomain(unmanagedDCS))
            {
                DomainCompressedStack.GetDomainPermissionSets(unmanagedDCS, out set2, out set3);
                set.Update(currentTriple, set2, set3);
            }
            set.Terminate(currentTriple);
            return(set);
        }
示例#2
0
        internal static PermissionListSet CreateCompressedState(IntPtr unmanagedDCS, out bool bHaltConstruction)
        {
            PermissionListSet   permissionListSet = new PermissionListSet();
            PermissionSetTriple currentTriple     = new PermissionSetTriple();
            int descCount = DomainCompressedStack.GetDescCount(unmanagedDCS);

            bHaltConstruction = false;
            PermissionSet granted;
            PermissionSet refused;

            for (int index = 0; index < descCount && !bHaltConstruction; ++index)
            {
                Assembly assembly;
                FrameSecurityDescriptor fsd;
                if (DomainCompressedStack.GetDescriptorInfo(unmanagedDCS, index, out granted, out refused, out assembly, out fsd))
                {
                    bHaltConstruction = permissionListSet.Update(currentTriple, fsd);
                }
                else
                {
                    permissionListSet.Update(currentTriple, granted, refused);
                }
            }
            if (!bHaltConstruction && !DomainCompressedStack.IgnoreDomain(unmanagedDCS))
            {
                DomainCompressedStack.GetDomainPermissionSets(unmanagedDCS, out granted, out refused);
                permissionListSet.Update(currentTriple, granted, refused);
            }
            permissionListSet.Terminate(currentTriple);
            return(permissionListSet);
        }
示例#3
0
        internal static PermissionListSet CreateCompressedState(IntPtr unmanagedDCS, out bool bHaltConstruction)
        {
            PermissionListSet   permissionListSet = new PermissionListSet();
            PermissionSetTriple currentTriple     = new PermissionSetTriple();
            int descCount = DomainCompressedStack.GetDescCount(unmanagedDCS);

            bHaltConstruction = false;
            int num = 0;

            while (num < descCount && !bHaltConstruction)
            {
                PermissionSet           in_g;
                PermissionSet           in_r;
                Assembly                assembly;
                FrameSecurityDescriptor fsd;
                if (DomainCompressedStack.GetDescriptorInfo(unmanagedDCS, num, out in_g, out in_r, out assembly, out fsd))
                {
                    bHaltConstruction = permissionListSet.Update(currentTriple, fsd);
                }
                else
                {
                    permissionListSet.Update(currentTriple, in_g, in_r);
                }
                num++;
            }
            if (!bHaltConstruction && !DomainCompressedStack.IgnoreDomain(unmanagedDCS))
            {
                PermissionSet in_g;
                PermissionSet in_r;
                DomainCompressedStack.GetDomainPermissionSets(unmanagedDCS, out in_g, out in_r);
                permissionListSet.Update(currentTriple, in_g, in_r);
            }
            permissionListSet.Terminate(currentTriple);
            return(permissionListSet);
        }
示例#4
0
        [System.Security.SecurityCritical]  // auto-generated
        static internal PermissionListSet CreateCompressedState(IntPtr unmanagedDCS, out bool bHaltConstruction)
        {
            PermissionListSet   pls           = new PermissionListSet();
            PermissionSetTriple currentTriple = new PermissionSetTriple();

            PermissionSet tmp_g, tmp_r;
            // Construct the descriptor list
            int descCount = DomainCompressedStack.GetDescCount(unmanagedDCS);

            bHaltConstruction = false;
            for (int i = 0; (i < descCount && !bHaltConstruction); i++)
            {
                FrameSecurityDescriptor fsd;
                Assembly assembly;
                if (DomainCompressedStack.GetDescriptorInfo(unmanagedDCS, i, out tmp_g, out tmp_r, out assembly, out fsd))
                {
                    // Got an FSD
                    bHaltConstruction = pls.Update(currentTriple, fsd);
                }
                else
                {
                    pls.Update(currentTriple, tmp_g, tmp_r);
                }
            }
            if (!bHaltConstruction)
            {
                // domain
                if (!DomainCompressedStack.IgnoreDomain(unmanagedDCS))
                {
                    DomainCompressedStack.GetDomainPermissionSets(unmanagedDCS, out tmp_g, out tmp_r);
                    pls.Update(currentTriple, tmp_g, tmp_r);
                }
            }
            pls.Terminate(currentTriple);


            // return the created object
            return(pls);
        }
示例#5
0
        // public(internal) interface begins...
        // Creation functions
        static internal PermissionListSet CreateCompressedState(CompressedStack cs, CompressedStack innerCS)
        {
            // function that completes the construction of the compressed stack if not done so already (bottom half for demand evaluation)

            bool bHaltConstruction = false;

            if (cs.CompressedStackHandle == null)
            {
                return(null); //  FT case or Security off
            }
            PermissionListSet   pls           = new PermissionListSet();
            PermissionSetTriple currentTriple = new PermissionSetTriple();
            int numDomains = CompressedStack.GetDCSCount(cs.CompressedStackHandle);

            for (int i = numDomains - 1; (i >= 0 && !bHaltConstruction); i--)
            {
                DomainCompressedStack dcs = CompressedStack.GetDomainCompressedStack(cs.CompressedStackHandle, i);
                if (dcs == null)
                {
                    continue; // we hit a FT Domain
                }
                if (dcs.PLS == null)
                {
                    // We failed on some DCS
                    throw new SecurityException(String.Format(CultureInfo.InvariantCulture, Environment.GetResourceString("Security_Generic")));
                }
                pls.UpdateZoneAndOrigin(dcs.PLS);
                pls.Update(currentTriple, dcs.PLS);
                bHaltConstruction = dcs.ConstructionHalted;
            }
            if (!bHaltConstruction)
            {
                PermissionListSet tmp_pls = null;
                // Construction did not halt.
                if (innerCS != null)
                {
                    innerCS.CompleteConstruction(null);
                    tmp_pls = innerCS.PLS;
                }
                pls.Terminate(currentTriple, tmp_pls);
            }
            else
            {
                pls.Terminate(currentTriple);
            }

            return(pls);
        }
示例#6
0
        internal static PermissionListSet CreateCompressedState(CompressedStack cs, CompressedStack innerCS)
        {
            bool flag = false;

            if (cs.CompressedStackHandle == null)
            {
                return(null);
            }
            PermissionListSet   permissionListSet = new PermissionListSet();
            PermissionSetTriple currentTriple     = new PermissionSetTriple();
            int dcscount = CompressedStack.GetDCSCount(cs.CompressedStackHandle);
            int num      = dcscount - 1;

            while (num >= 0 && !flag)
            {
                DomainCompressedStack domainCompressedStack = CompressedStack.GetDomainCompressedStack(cs.CompressedStackHandle, num);
                if (domainCompressedStack != null)
                {
                    if (domainCompressedStack.PLS == null)
                    {
                        throw new SecurityException(string.Format(CultureInfo.InvariantCulture, Environment.GetResourceString("Security_Generic"), Array.Empty <object>()));
                    }
                    permissionListSet.UpdateZoneAndOrigin(domainCompressedStack.PLS);
                    permissionListSet.Update(currentTriple, domainCompressedStack.PLS);
                    flag = domainCompressedStack.ConstructionHalted;
                }
                num--;
            }
            if (!flag)
            {
                PermissionListSet pls = null;
                if (innerCS != null)
                {
                    innerCS.CompleteConstruction(null);
                    pls = innerCS.PLS;
                }
                permissionListSet.Terminate(currentTriple, pls);
            }
            else
            {
                permissionListSet.Terminate(currentTriple);
            }
            return(permissionListSet);
        }
示例#7
0
        internal static PermissionListSet CreateCompressedState(CompressedStack cs, CompressedStack innerCS)
        {
            bool constructionHalted = false;

            if (cs.CompressedStackHandle == null)
            {
                return(null);
            }
            PermissionListSet   set           = new PermissionListSet();
            PermissionSetTriple currentTriple = new PermissionSetTriple();

            for (int i = CompressedStack.GetDCSCount(cs.CompressedStackHandle) - 1; (i >= 0) && !constructionHalted; i--)
            {
                DomainCompressedStack domainCompressedStack = CompressedStack.GetDomainCompressedStack(cs.CompressedStackHandle, i);
                if (domainCompressedStack != null)
                {
                    if (domainCompressedStack.PLS == null)
                    {
                        throw new SecurityException(string.Format(CultureInfo.InvariantCulture, Environment.GetResourceString("Security_Generic"), new object[0]));
                    }
                    set.UpdateZoneAndOrigin(domainCompressedStack.PLS);
                    set.Update(currentTriple, domainCompressedStack.PLS);
                    constructionHalted = domainCompressedStack.ConstructionHalted;
                }
            }
            if (!constructionHalted)
            {
                PermissionListSet pls = null;
                if (innerCS != null)
                {
                    innerCS.CompleteConstruction(null);
                    pls = innerCS.PLS;
                }
                set.Terminate(currentTriple, pls);
                return(set);
            }
            set.Terminate(currentTriple);
            return(set);
        }
示例#8
0
        [System.Security.SecurityCritical]  // auto-generated 
        static internal PermissionListSet CreateCompressedState(IntPtr unmanagedDCS, out bool bHaltConstruction)
        { 
            PermissionListSet pls = new PermissionListSet();
            PermissionSetTriple currentTriple = new PermissionSetTriple();

            PermissionSet tmp_g, tmp_r; 
            // Construct the descriptor list
            int descCount = DomainCompressedStack.GetDescCount(unmanagedDCS); 
            bHaltConstruction = false; 
            for(int i=0; (i < descCount && !bHaltConstruction); i++)
            { 
                FrameSecurityDescriptor fsd;
                Assembly assembly;
                if (DomainCompressedStack.GetDescriptorInfo(unmanagedDCS, i, out tmp_g, out tmp_r, out assembly, out fsd))
                { 
                    // Got an FSD
                    bHaltConstruction = pls.Update(currentTriple, fsd); 
                } 
                else
                { 
                    pls.Update(currentTriple, tmp_g, tmp_r);
                }

            } 
            if (!bHaltConstruction)
            { 
                // domain 
                if (!DomainCompressedStack.IgnoreDomain(unmanagedDCS))
                { 
                    DomainCompressedStack.GetDomainPermissionSets(unmanagedDCS, out tmp_g, out tmp_r);
                    pls.Update(currentTriple, tmp_g, tmp_r);
                }
            } 
            pls.Terminate(currentTriple);
 
 
            // return the created object
            return pls; 

        }
示例#9
0
        // public(internal) interface begins... 
        // Creation functions 
        static internal PermissionListSet CreateCompressedState(CompressedStack cs, CompressedStack innerCS)
        { 
            // function that completes the construction of the compressed stack if not done so already (bottom half for demand evaluation)

            bool bHaltConstruction = false;
            if (cs.CompressedStackHandle == null) 
                return null; //  FT case or Security off
 
            PermissionListSet pls = new PermissionListSet(); 
            PermissionSetTriple currentTriple = new PermissionSetTriple();
            int numDomains = CompressedStack.GetDCSCount(cs.CompressedStackHandle); 
            for (int i=numDomains-1; (i >= 0 && !bHaltConstruction) ; i--)
            {
                DomainCompressedStack dcs = CompressedStack.GetDomainCompressedStack(cs.CompressedStackHandle, i);
                if (dcs == null) 
                    continue; // we hit a FT Domain
                if (dcs.PLS == null) 
                { 
                    // We failed on some DCS
                    throw new SecurityException(String.Format(CultureInfo.InvariantCulture, Environment.GetResourceString("Security_Generic"))); 
                }
                pls.UpdateZoneAndOrigin(dcs.PLS);
                pls.Update(currentTriple, dcs.PLS);
                bHaltConstruction = dcs.ConstructionHalted; 
            }
            if (!bHaltConstruction) 
            { 
                PermissionListSet tmp_pls = null;
                // Construction did not halt. 
                if (innerCS != null)
                {
                    innerCS.CompleteConstruction(null);
                    tmp_pls = innerCS.PLS; 
                }
                pls.Terminate(currentTriple, tmp_pls); 
            } 
            else
            { 
                pls.Terminate(currentTriple);
            }

            return pls; 
        }
 internal static PermissionListSet CreateCompressedState(CompressedStack cs, CompressedStack innerCS)
 {
     bool constructionHalted = false;
     if (cs.CompressedStackHandle == null)
     {
         return null;
     }
     PermissionListSet set = new PermissionListSet();
     PermissionSetTriple currentTriple = new PermissionSetTriple();
     for (int i = CompressedStack.GetDCSCount(cs.CompressedStackHandle) - 1; (i >= 0) && !constructionHalted; i--)
     {
         DomainCompressedStack domainCompressedStack = CompressedStack.GetDomainCompressedStack(cs.CompressedStackHandle, i);
         if (domainCompressedStack != null)
         {
             if (domainCompressedStack.PLS == null)
             {
                 throw new SecurityException(string.Format(CultureInfo.InvariantCulture, Environment.GetResourceString("Security_Generic"), new object[0]));
             }
             set.UpdateZoneAndOrigin(domainCompressedStack.PLS);
             set.Update(currentTriple, domainCompressedStack.PLS);
             constructionHalted = domainCompressedStack.ConstructionHalted;
         }
     }
     if (!constructionHalted)
     {
         PermissionListSet pls = null;
         if (innerCS != null)
         {
             innerCS.CompleteConstruction(null);
             pls = innerCS.PLS;
         }
         set.Terminate(currentTriple, pls);
         return set;
     }
     set.Terminate(currentTriple);
     return set;
 }
 internal static PermissionListSet CreateCompressedState(IntPtr unmanagedDCS, out bool bHaltConstruction)
 {
     PermissionSet set2;
     PermissionSet set3;
     PermissionListSet set = new PermissionListSet();
     PermissionSetTriple currentTriple = new PermissionSetTriple();
     int descCount = DomainCompressedStack.GetDescCount(unmanagedDCS);
     bHaltConstruction = false;
     for (int i = 0; (i < descCount) && !bHaltConstruction; i++)
     {
         FrameSecurityDescriptor descriptor;
         Assembly assembly;
         if (DomainCompressedStack.GetDescriptorInfo(unmanagedDCS, i, out set2, out set3, out assembly, out descriptor))
         {
             bHaltConstruction = set.Update(currentTriple, descriptor);
         }
         else
         {
             set.Update(currentTriple, set2, set3);
         }
     }
     if (!bHaltConstruction && !DomainCompressedStack.IgnoreDomain(unmanagedDCS))
     {
         DomainCompressedStack.GetDomainPermissionSets(unmanagedDCS, out set2, out set3);
         set.Update(currentTriple, set2, set3);
     }
     set.Terminate(currentTriple);
     return set;
 }