mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 02:48:12 +02:00
flag node as local by sending address, not by local from packet
This commit is contained in:
parent
5e5b77fbaa
commit
57a92adc73
1 changed files with 5 additions and 5 deletions
|
@ -272,22 +272,22 @@ void DomainGatekeeper::updateNodePermissions() {
|
||||||
userPerms.permissions |= NodePermissions::Permission::canWriteToAssetServer;
|
userPerms.permissions |= NodePermissions::Permission::canWriteToAssetServer;
|
||||||
userPerms.permissions |= NodePermissions::Permission::canReplaceDomainContent;
|
userPerms.permissions |= NodePermissions::Permission::canReplaceDomainContent;
|
||||||
} else {
|
} else {
|
||||||
// this node is an agent
|
|
||||||
const QHostAddress& addr = node->getLocalSocket().getAddress();
|
|
||||||
bool isLocalUser = (addr == limitedNodeList->getLocalSockAddr().getAddress() ||
|
|
||||||
addr == QHostAddress::LocalHost);
|
|
||||||
|
|
||||||
// at this point we don't have a sending socket for packets from this node - assume it is the active socket
|
// at this point we don't have a sending socket for packets from this node - assume it is the active socket
|
||||||
// or the public socket if we haven't activated a socket for the node yet
|
// or the public socket if we haven't activated a socket for the node yet
|
||||||
HifiSockAddr connectingAddr = node->getActiveSocket() ? *node->getActiveSocket() : node->getPublicSocket();
|
HifiSockAddr connectingAddr = node->getActiveSocket() ? *node->getActiveSocket() : node->getPublicSocket();
|
||||||
|
|
||||||
QString hardwareAddress;
|
QString hardwareAddress;
|
||||||
QUuid machineFingerprint;
|
QUuid machineFingerprint;
|
||||||
|
bool isLocalUser { false };
|
||||||
|
|
||||||
DomainServerNodeData* nodeData = static_cast<DomainServerNodeData*>(node->getLinkedData());
|
DomainServerNodeData* nodeData = static_cast<DomainServerNodeData*>(node->getLinkedData());
|
||||||
if (nodeData) {
|
if (nodeData) {
|
||||||
hardwareAddress = nodeData->getHardwareAddress();
|
hardwareAddress = nodeData->getHardwareAddress();
|
||||||
machineFingerprint = nodeData->getMachineFingerprint();
|
machineFingerprint = nodeData->getMachineFingerprint();
|
||||||
|
|
||||||
|
auto sendingAddress = nodeData->getSendingSockAddr().getAddress();
|
||||||
|
isLocalUser = (sendingAddress == limitedNodeList->getLocalSockAddr().getAddress() ||
|
||||||
|
sendingAddress == QHostAddress::LocalHost);
|
||||||
}
|
}
|
||||||
|
|
||||||
userPerms = setPermissionsForUser(isLocalUser, verifiedUsername, connectingAddr.getAddress(), hardwareAddress, machineFingerprint);
|
userPerms = setPermissionsForUser(isLocalUser, verifiedUsername, connectingAddr.getAddress(), hardwareAddress, machineFingerprint);
|
||||||
|
|
Loading…
Reference in a new issue