* repeater & room server fix for blank guest password
This commit is contained in:
@@ -83,16 +83,16 @@ void MyMesh::putNeighbour(const mesh::Identity &id, uint32_t timestamp, float sn
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint8_t MyMesh::handleLoginReq(const mesh::Identity& sender, const uint8_t* secret, uint32_t sender_timestamp, const uint8_t* data) {
|
uint8_t MyMesh::handleLoginReq(const mesh::Identity& sender, const uint8_t* secret, uint32_t sender_timestamp, const uint8_t* data) {
|
||||||
ClientInfo* client;
|
ClientInfo* client = NULL;
|
||||||
if (data[0] == 0) { // blank password, just check if sender is in ACL
|
if (data[0] == 0) { // blank password, just check if sender is in ACL
|
||||||
client = acl.getClient(sender.pub_key, PUB_KEY_SIZE);
|
client = acl.getClient(sender.pub_key, PUB_KEY_SIZE);
|
||||||
if (client == NULL) {
|
if (client == NULL) {
|
||||||
#if MESH_DEBUG
|
#if MESH_DEBUG
|
||||||
MESH_DEBUG_PRINTLN("Login, sender not in ACL");
|
MESH_DEBUG_PRINTLN("Login, sender not in ACL");
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
if (client == NULL) {
|
||||||
uint8_t perms;
|
uint8_t perms;
|
||||||
if (strcmp((char *)data, _prefs.password) == 0) { // check for valid admin password
|
if (strcmp((char *)data, _prefs.password) == 0) { // check for valid admin password
|
||||||
perms = PERM_ACL_ADMIN;
|
perms = PERM_ACL_ADMIN;
|
||||||
|
|||||||
@@ -289,16 +289,16 @@ void MyMesh::onAnonDataRecv(mesh::Packet *packet, const uint8_t *secret, const m
|
|||||||
|
|
||||||
data[len] = 0; // ensure null terminator
|
data[len] = 0; // ensure null terminator
|
||||||
|
|
||||||
ClientInfo* client;
|
ClientInfo* client = NULL;
|
||||||
if (data[8] == 0 && !_prefs.allow_read_only) { // blank password, just check if sender is in ACL
|
if (data[8] == 0 && !_prefs.allow_read_only) { // blank password, just check if sender is in ACL
|
||||||
client = acl.getClient(sender.pub_key, PUB_KEY_SIZE);
|
client = acl.getClient(sender.pub_key, PUB_KEY_SIZE);
|
||||||
if (client == NULL) {
|
if (client == NULL) {
|
||||||
#if MESH_DEBUG
|
#if MESH_DEBUG
|
||||||
MESH_DEBUG_PRINTLN("Login, sender not in ACL");
|
MESH_DEBUG_PRINTLN("Login, sender not in ACL");
|
||||||
#endif
|
#endif
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
if (client == NULL) {
|
||||||
uint8_t perm;
|
uint8_t perm;
|
||||||
if (strcmp((char *)&data[8], _prefs.password) == 0) { // check for valid admin password
|
if (strcmp((char *)&data[8], _prefs.password) == 0) { // check for valid admin password
|
||||||
perm = PERM_ACL_ADMIN;
|
perm = PERM_ACL_ADMIN;
|
||||||
|
|||||||
Reference in New Issue
Block a user