diff options
Diffstat (limited to 'OpenSim/Data/PGSQL/PGSQLManager.cs')
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLManager.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/OpenSim/Data/PGSQL/PGSQLManager.cs b/OpenSim/Data/PGSQL/PGSQLManager.cs index 3ddaf38..97f40b2 100644 --- a/OpenSim/Data/PGSQL/PGSQLManager.cs +++ b/OpenSim/Data/PGSQL/PGSQLManager.cs | |||
@@ -30,6 +30,7 @@ using System.Collections.Generic; | |||
30 | using System.Data; | 30 | using System.Data; |
31 | using System.IO; | 31 | using System.IO; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using OpenSim.Framework; | ||
33 | using log4net; | 34 | using log4net; |
34 | using OpenMetaverse; | 35 | using OpenMetaverse; |
35 | using Npgsql; | 36 | using Npgsql; |
@@ -56,6 +57,34 @@ namespace OpenSim.Data.PGSQL | |||
56 | public PGSQLManager(string connection) | 57 | public PGSQLManager(string connection) |
57 | { | 58 | { |
58 | connectionString = connection; | 59 | connectionString = connection; |
60 | InitializeMonoSecurity(); | ||
61 | } | ||
62 | |||
63 | public void InitializeMonoSecurity() | ||
64 | { | ||
65 | if (!Util.IsPlatformMono) | ||
66 | { | ||
67 | if (AppDomain.CurrentDomain.GetData("MonoSecurityPostgresAdded") == null) | ||
68 | { | ||
69 | AppDomain.CurrentDomain.SetData("MonoSecurityPostgresAdded", "true"); | ||
70 | |||
71 | AppDomain currentDomain = AppDomain.CurrentDomain; | ||
72 | currentDomain.AssemblyResolve += new ResolveEventHandler(ResolveEventHandlerMonoSec); | ||
73 | } | ||
74 | } | ||
75 | } | ||
76 | |||
77 | private System.Reflection.Assembly ResolveEventHandlerMonoSec(object sender, ResolveEventArgs args) | ||
78 | { | ||
79 | Assembly MyAssembly = null; | ||
80 | |||
81 | if (args.Name.Substring(0, args.Name.IndexOf(",")) == "Mono.Security") | ||
82 | { | ||
83 | MyAssembly = Assembly.LoadFrom("lib/NET/Mono.Security.dll"); | ||
84 | } | ||
85 | |||
86 | //Return the loaded assembly. | ||
87 | return MyAssembly; | ||
59 | } | 88 | } |
60 | 89 | ||
61 | /// <summary> | 90 | /// <summary> |