aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/PermissionsUtil.cs48
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs3
-rw-r--r--OpenSim/Framework/Util.cs7
3 files changed, 54 insertions, 4 deletions
diff --git a/OpenSim/Framework/PermissionsUtil.cs b/OpenSim/Framework/PermissionsUtil.cs
index 3dce04d..e50d4df 100644
--- a/OpenSim/Framework/PermissionsUtil.cs
+++ b/OpenSim/Framework/PermissionsUtil.cs
@@ -60,9 +60,57 @@ namespace OpenSim.Framework
60 str += "C"; 60 str += "C";
61 if ((perms & (int)PermissionMask.Transfer) != 0) 61 if ((perms & (int)PermissionMask.Transfer) != 0)
62 str += "T"; 62 str += "T";
63 if ((perms & (int)PermissionMask.Export) != 0)
64 str += "X";
63 if (str == "") 65 if (str == "")
64 str = "."; 66 str = ".";
65 return str; 67 return str;
66 } 68 }
69
70 public static void ApplyFoldedPermissions(uint foldedSourcePerms, ref uint targetPerms)
71 {
72 uint folded = foldedSourcePerms & (uint)PermissionMask.FoldedMask;
73 if(folded == 0 || folded == (uint)PermissionMask.FoldedMask) // invalid we need to ignore, or nothing to do
74 return;
75
76 folded <<= (int)PermissionMask.FoldingShift;
77 folded |= ~(uint)PermissionMask.UnfoldedMask;
78
79 uint tmp = targetPerms;
80 tmp &= folded;
81 targetPerms = tmp;
82 }
83
84 // do not touch MOD
85 public static void ApplyNoModFoldedPermissions(uint foldedSourcePerms, ref uint target)
86 {
87 uint folded = foldedSourcePerms & (uint)PermissionMask.FoldedMask;
88 if(folded == 0 || folded == (uint)PermissionMask.FoldedMask) // invalid we need to ignore, or nothing to do
89 return;
90
91 folded <<= (int)PermissionMask.FoldingShift;
92 folded |= (~(uint)PermissionMask.UnfoldedMask | (uint)PermissionMask.Modify);
93
94 uint tmp = target;
95 tmp &= folded;
96 target = tmp;
97 }
98
99 public static uint FixAndFoldPermissions(uint perms)
100 {
101 uint tmp = perms;
102
103 // C & T rule
104 if((tmp & (uint)(PermissionMask.Copy | PermissionMask.Transfer)) == 0)
105 tmp |= (uint)PermissionMask.Transfer;
106
107 // unlock
108 tmp |= (uint)PermissionMask.Move;
109
110 tmp &= ~(uint)PermissionMask.FoldedMask;
111 tmp |= ((tmp >> (int)PermissionMask.FoldingShift) & (uint)PermissionMask.FoldedMask);
112
113 return tmp;
114 }
67 } 115 }
68} 116}
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 5111673..c7f0136 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -191,8 +191,7 @@ namespace OpenSim.Framework.Servers
191 } 191 }
192 catch(Exception e) 192 catch(Exception e)
193 { 193 {
194 m_log.FatalFormat("Fatal error: {0}", 194 m_log.Fatal("Fatal error: " + e.ToString());
195 (e.Message == null || e.Message == String.Empty) ? "Unknown reason":e.Message );
196 Environment.Exit(1); 195 Environment.Exit(1);
197 } 196 }
198 197
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 0ec24e6..f6ded04 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -79,7 +79,9 @@ namespace OpenSim.Framework
79 79
80 FoldedMask = 0x0f, 80 FoldedMask = 0x0f,
81 81
82 // 82 FoldingShift = 13 , // number of bit shifts from normal perm to folded or back (same as Transfer shift below)
83 // when doing as a block
84
83 Transfer = 1 << 13, // 0x02000 85 Transfer = 1 << 13, // 0x02000
84 Modify = 1 << 14, // 0x04000 86 Modify = 1 << 14, // 0x04000
85 Copy = 1 << 15, // 0x08000 87 Copy = 1 << 15, // 0x08000
@@ -90,7 +92,8 @@ namespace OpenSim.Framework
90 // explicitly given 92 // explicitly given
91 All = 0x8e000, 93 All = 0x8e000,
92 AllAndExport = 0x9e000, 94 AllAndExport = 0x9e000,
93 AllEffective = 0x9e000 95 AllEffective = 0x9e000,
96 UnfoldedMask = 0x1e000
94 } 97 }
95 98
96 /// <summary> 99 /// <summary>