diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLFramework.cs | 23 | ||||
-rw-r--r-- | OpenSim/Data/PGSQL/PGSQLManager.cs | 24 |
2 files changed, 47 insertions, 0 deletions
diff --git a/OpenSim/Data/PGSQL/PGSQLFramework.cs b/OpenSim/Data/PGSQL/PGSQLFramework.cs index 494b0aa..48f8dd3 100644 --- a/OpenSim/Data/PGSQL/PGSQLFramework.cs +++ b/OpenSim/Data/PGSQL/PGSQLFramework.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Data; | 31 | using System.Data; |
32 | using System.Reflection; | ||
32 | using OpenMetaverse; | 33 | using OpenMetaverse; |
33 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
34 | using Npgsql; | 35 | using Npgsql; |
@@ -50,8 +51,30 @@ namespace OpenSim.Data.PGSQL | |||
50 | protected PGSqlFramework(string connectionString) | 51 | protected PGSqlFramework(string connectionString) |
51 | { | 52 | { |
52 | m_connectionString = connectionString; | 53 | m_connectionString = connectionString; |
54 | InitializeMonoSecurity(); | ||
53 | } | 55 | } |
54 | 56 | ||
57 | public void InitializeMonoSecurity() | ||
58 | { | ||
59 | if (!Util.IsPlatformMono) | ||
60 | { | ||
61 | AppDomain currentDomain = AppDomain.CurrentDomain; | ||
62 | currentDomain.AssemblyResolve += new ResolveEventHandler(ResolveEventHandlerMonoSec); | ||
63 | } | ||
64 | } | ||
65 | |||
66 | private System.Reflection.Assembly ResolveEventHandlerMonoSec(object sender, ResolveEventArgs args) | ||
67 | { | ||
68 | Assembly MyAssembly = null; | ||
69 | |||
70 | if (args.Name.Substring(0, args.Name.IndexOf(",")) == "Mono.Security") | ||
71 | { | ||
72 | MyAssembly = Assembly.LoadFrom("lib/NET/Mono.Security.dll"); | ||
73 | } | ||
74 | |||
75 | //Return the loaded assembly. | ||
76 | return MyAssembly; | ||
77 | } | ||
55 | ////////////////////////////////////////////////////////////// | 78 | ////////////////////////////////////////////////////////////// |
56 | // | 79 | // |
57 | // All non queries are funneled through one connection | 80 | // All non queries are funneled through one connection |
diff --git a/OpenSim/Data/PGSQL/PGSQLManager.cs b/OpenSim/Data/PGSQL/PGSQLManager.cs index 3ddaf38..2084fe9 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,29 @@ 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 | AppDomain currentDomain = AppDomain.CurrentDomain; | ||
68 | currentDomain.AssemblyResolve += new ResolveEventHandler(ResolveEventHandlerMonoSec); | ||
69 | } | ||
70 | } | ||
71 | |||
72 | private System.Reflection.Assembly ResolveEventHandlerMonoSec(object sender, ResolveEventArgs args) | ||
73 | { | ||
74 | Assembly MyAssembly = null; | ||
75 | |||
76 | if (args.Name.Substring(0, args.Name.IndexOf(",")) == "Mono.Security") | ||
77 | { | ||
78 | MyAssembly = Assembly.LoadFrom("lib/NET/Mono.Security.dll"); | ||
79 | } | ||
80 | |||
81 | //Return the loaded assembly. | ||
82 | return MyAssembly; | ||
59 | } | 83 | } |
60 | 84 | ||
61 | /// <summary> | 85 | /// <summary> |