Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/18/10 22:16:04 (14 years ago)
Author:
kgrading
Message:

#828 added various improvements to the plugin cache manager, the execution engine, the transaction handling on the serverside and the server console

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/sources/HeuristicLab.PluginInfrastructure/Sandboxing/SandboxManager.cs

    r3578 r4042  
    6565
    6666      #region permission set for sandbox
    67       // Uncomment code for sandboxed appdomain
    68       //pset = new PermissionSet(PermissionState.None);
    69       //pset.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution));
    70       //pset.AddPermission(new ReflectionPermission(ReflectionPermissionFlag.MemberAccess));
    71       //FileIOPermission fPerm = new FileIOPermission(PermissionState.None);
     67      //Uncomment code for sandboxed appdomain
     68      pset = new PermissionSet(PermissionState.None);
     69      pset.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution));
     70      pset.AddPermission(new ReflectionPermission(ReflectionPermissionFlag.AllFlags));
     71      FileIOPermission fPerm = new FileIOPermission(PermissionState.None);
    7272
    73       //foreach (IPluginDescription plugin in ApplicationManager.Manager.Plugins) {
    74       //  fPerm.AddPathList(FileIOPermissionAccess.Read | FileIOPermissionAccess.PathDiscovery, plugin.Files.ToArray());
    75       //}
     73      foreach (IPluginDescription plugin in ApplicationManager.Manager.Plugins) {
     74        foreach (IPluginFile pluginFile in plugin.Files) {
     75          fPerm.AddPathList(FileIOPermissionAccess.Read | FileIOPermissionAccess.PathDiscovery, pluginFile.Name); 
     76          //fPerm.AddPathList(FileIOPermissionAccess.AllAccess, pluginFile.Name); 
     77        }       
     78      }
    7679
    77       //pset.AddPermission(fPerm);
     80      pset.AddPermission(fPerm);
    7881      #endregion
    7982
    8083      #region permission set of unrestricted appdomain
    8184      // unrestricted appdomain
    82       pset = new PermissionSet(PermissionState.Unrestricted);
     85      //pset = new PermissionSet(PermissionState.Unrestricted);
    8386      #endregion
    8487
     
    8689      //setup.PrivateBinPath = pluginDir;
    8790      setup.ApplicationBase = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
    88       AppDomain applicationDomain = AppDomain.CreateDomain(name, AppDomain.CurrentDomain.Evidence, setup, pset, CreateStrongName(Assembly.GetExecutingAssembly()));
     91      AppDomain applicationDomain = AppDomain.CreateDomain(name, AppDomain.CurrentDomain.Evidence, setup, pset, new StrongName[] {CreateStrongName(Assembly.GetExecutingAssembly())});
     92
    8993      Type applicationManagerType = typeof(DefaultApplicationManager);
    9094      DefaultApplicationManager applicationManager =
     
    9397      PluginDescription[] plugins = ApplicationManager.Manager.Plugins.Cast<PluginDescription>().ToArray();
    9498      applicationManager.PrepareApplicationDomain(apps, plugins);
    95       //if (files != null && files.Count() > 0)
    96         //applicationManager.LoadAssemblies(files);
     99      if (files != null && files.Count() > 0)
     100        applicationManager.LoadAssemblies(files);
    97101      return applicationDomain;
    98102    }
Note: See TracChangeset for help on using the changeset viewer.