mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 22:39:18 +02:00
flip domain-server local connect conditional
This commit is contained in:
parent
d00e11541e
commit
9a842e2202
2 changed files with 7 additions and 5 deletions
|
@ -64,7 +64,7 @@
|
||||||
"name": "allowed_users",
|
"name": "allowed_users",
|
||||||
"type": "table",
|
"type": "table",
|
||||||
"label": "Allowed Users",
|
"label": "Allowed Users",
|
||||||
"help": "List the High Fidelity names for people you want to be able to connect to this domain.<br/>An empty list means everyone.<br/>You can always connect from this machine.",
|
"help": "List the High Fidelity names for people you want to be able to connect to this domain.<br/>An empty list means everyone.<br/>You can always connect from the domain-server machine.",
|
||||||
"numbered": false,
|
"numbered": false,
|
||||||
"columns": [
|
"columns": [
|
||||||
{
|
{
|
||||||
|
|
|
@ -616,13 +616,13 @@ const QString ALLOWED_USERS_SETTINGS_KEYPATH = "security.allowed_users";
|
||||||
bool DomainServer::shouldAllowConnectionFromNode(const QString& username,
|
bool DomainServer::shouldAllowConnectionFromNode(const QString& username,
|
||||||
const QByteArray& usernameSignature,
|
const QByteArray& usernameSignature,
|
||||||
const HifiSockAddr& senderSockAddr) {
|
const HifiSockAddr& senderSockAddr) {
|
||||||
static const QVariant* allowedUsersVariant = valueForKeyPath(_settingsManager.getSettingsMap(),
|
const QVariant* allowedUsersVariant = valueForKeyPath(_settingsManager.getSettingsMap(),
|
||||||
ALLOWED_USERS_SETTINGS_KEYPATH);
|
ALLOWED_USERS_SETTINGS_KEYPATH);
|
||||||
static QStringList allowedUsers = allowedUsersVariant ? allowedUsersVariant->toStringList() : QStringList();
|
QStringList allowedUsers = allowedUsersVariant ? allowedUsersVariant->toStringList() : QStringList();
|
||||||
|
|
||||||
// we always let in a user who is sending a packet from our local socket or from the localhost address
|
// we always let in a user who is sending a packet from our local socket or from the localhost address
|
||||||
if (senderSockAddr.getAddress() != LimitedNodeList::getInstance()->getLocalSockAddr().getAddress()
|
if (senderSockAddr.getAddress() == LimitedNodeList::getInstance()->getLocalSockAddr().getAddress()
|
||||||
&& senderSockAddr.getAddress() != QHostAddress::LocalHost) {
|
&& senderSockAddr.getAddress() == QHostAddress::LocalHost) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -670,6 +670,8 @@ bool DomainServer::shouldAllowConnectionFromNode(const QString& username,
|
||||||
}
|
}
|
||||||
|
|
||||||
requestUserPublicKey(username);
|
requestUserPublicKey(username);
|
||||||
|
} else {
|
||||||
|
qDebug() << "Connect request denied for user" << username << "not in allowed users list.";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// since we have no allowed user list, let them all in
|
// since we have no allowed user list, let them all in
|
||||||
|
|
Loading…
Reference in a new issue