mirror of
https://github.com/opensim/opensim.git
synced 2026-06-10 05:55:38 +08:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf8778f50f | ||
|
|
a61b946563 | ||
|
|
93ebb36904 | ||
|
|
6a679f7cfa | ||
|
|
9c2cc2d1af | ||
|
|
ad1d137c2e | ||
|
|
d88947e07a | ||
|
|
dfb3aed36a | ||
|
|
fc75ae0011 | ||
|
|
82842f26cc | ||
|
|
e306a1c1de | ||
|
|
a4b5986271 | ||
|
|
dfd03c01ff | ||
|
|
3c1ecad319 |
@@ -417,7 +417,7 @@ namespace osWebRtcVoice
|
||||
m_log.Warn($"{LogHeader}[ProvisionVoice]: Request detail: {map}");
|
||||
|
||||
response.RawBuffer = llsdUndefAnswerBytes;
|
||||
response.StatusCode = (int)HttpStatusCode.OK;
|
||||
response.StatusCode = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,28 +115,39 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||
}
|
||||
|
||||
// This is it! Let's ask the other world
|
||||
if (words[0].Contains("."))
|
||||
if (words[0].Contains('.'))
|
||||
{
|
||||
string[] names = words[0].Split(Util.SplitDotArray);
|
||||
if (names.Length >= 2)
|
||||
{
|
||||
string uriStr = "http://" + words[1];
|
||||
ReadOnlySpan<char> words1lower = words[1].ToLower();
|
||||
string uriStr = string.Concat("http://", words1lower);
|
||||
|
||||
// Let's check that the last name is a valid address
|
||||
try
|
||||
if(!Uri.TryCreate(uriStr, UriKind.Absolute, out _))
|
||||
{
|
||||
new Uri(uriStr);
|
||||
}
|
||||
catch (UriFormatException)
|
||||
{
|
||||
m_log.DebugFormat("[USER MANAGEMENT MODULE]: Malformed address {0}", uriStr);
|
||||
m_log.Debug($"[USER MANAGEMENT MODULE]: Malformed address {words1lower}");
|
||||
return;
|
||||
}
|
||||
|
||||
UUID userID = UUID.Zero;
|
||||
uriStr = uriStr.ToLower();
|
||||
if(!WebUtil.GlobalExpiringBadURLs.ContainsKey(uriStr))
|
||||
{
|
||||
UserAgentServiceConnector uasConn = new UserAgentServiceConnector(uriStr);
|
||||
UserAgentServiceConnector uasConn = new(uriStr);
|
||||
|
||||
// If fail to connect with http... try with https...
|
||||
if (uasConn is null)
|
||||
{
|
||||
string SSLuriStr = string.Concat("https://", words1lower); // words[1] already validated
|
||||
uasConn = new UserAgentServiceConnector(SSLuriStr);
|
||||
if (uasConn is null)
|
||||
{
|
||||
m_log.Debug($"[USER MANAGEMENT MODULE]: UserAgentServiceConnector failed to connect to {words1lower}");
|
||||
return;
|
||||
}
|
||||
uriStr = SSLuriStr;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
userID = uasConn.GetUUID(names[0], names[1]);
|
||||
@@ -147,18 +158,20 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||
}
|
||||
}
|
||||
|
||||
if (!userID.Equals(UUID.Zero))
|
||||
if (userID.IsNotZero())
|
||||
{
|
||||
UserData ud = new UserData();
|
||||
ud.Id = userID;
|
||||
ud.FirstName = words[0];
|
||||
ud.LastName = "@" + words[1];
|
||||
UserData ud = new()
|
||||
{
|
||||
Id = userID,
|
||||
FirstName = words[0],
|
||||
LastName = "@" + words[1]
|
||||
};
|
||||
users.Add(ud);
|
||||
AddUser(userID, names[0], names[1], uriStr);
|
||||
m_log.DebugFormat("[USER MANAGEMENT MODULE]: User {0}@{1} found", words[0], words[1]);
|
||||
m_log.Debug($"[USER MANAGEMENT MODULE]: User {words[0]}@{words[1]} found");
|
||||
}
|
||||
else
|
||||
m_log.DebugFormat("[USER MANAGEMENT MODULE]: User {0}@{1} not found", words[0], words[1]);
|
||||
m_log.Debug($"[USER MANAGEMENT MODULE]: User {words[0]}@{words[1]} not found");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace OpenSim.Services.HypergridService
|
||||
if (configName != String.Empty)
|
||||
m_ConfigName = configName;
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
Object[] args = [ config ];
|
||||
|
||||
IConfig serverConfig = config.Configs[m_ConfigName];
|
||||
if (serverConfig == null)
|
||||
@@ -309,29 +309,39 @@ namespace OpenSim.Services.HypergridService
|
||||
// But now we need to confirm that the requester is who he says he is
|
||||
// before we act on the friendship request.
|
||||
|
||||
if (!fromName.Contains("@"))
|
||||
if (!fromName.Contains('@'))
|
||||
return;
|
||||
|
||||
string[] parts = fromName.Split(new char[] {'@'});
|
||||
if (parts.Length != 2)
|
||||
return;
|
||||
|
||||
string uriStr = "http://" + parts[1];
|
||||
try
|
||||
{
|
||||
new Uri(uriStr);
|
||||
}
|
||||
catch (UriFormatException)
|
||||
string uriStr = "http://" + parts[1].ToLower();
|
||||
string SSLuriStr = "https://" + parts[1].ToLower();
|
||||
if(!Uri.TryCreate(uriStr, UriKind.Absolute, out _))
|
||||
{
|
||||
m_log.DebugFormat("[HGFRIENDS SERVICE]: Malformed address {0}", parts[1].ToLower());
|
||||
return;
|
||||
}
|
||||
|
||||
UserAgentServiceConnector uasConn = new UserAgentServiceConnector(uriStr);
|
||||
UserAgentServiceConnector uasConn = new(uriStr);
|
||||
// If fail to connect with http... try with https...
|
||||
if (uasConn is null)
|
||||
{
|
||||
uasConn = new UserAgentServiceConnector(SSLuriStr);
|
||||
if (uasConn is null)
|
||||
{
|
||||
m_log.DebugFormat("[HGFRIENDS SERVICE]: UserAgentServiceConnector failed to connect to {0}", parts[1].ToLower());
|
||||
return;
|
||||
}
|
||||
uriStr = SSLuriStr;
|
||||
}
|
||||
|
||||
Dictionary<string, object> servers = uasConn.GetServerURLs(fromID);
|
||||
if (!servers.ContainsKey("FriendsServerURI"))
|
||||
if (!servers.TryGetValue("FriendsServerURI", out object friendsServerURI))
|
||||
return;
|
||||
|
||||
HGFriendsServicesConnector friendsConn = new HGFriendsServicesConnector(servers["FriendsServerURI"].ToString());
|
||||
HGFriendsServicesConnector friendsConn = new(friendsServerURI.ToString());
|
||||
if (!friendsConn.ValidateFriendshipOffered(fromID, toID))
|
||||
{
|
||||
m_log.WarnFormat("[HGFRIENDS SERVICE]: Friendship request from {0} to {1} is invalid. Impersonations?", fromID, toID);
|
||||
|
||||
Reference in New Issue
Block a user