Improve logging in dynsec addGroupClient command.

Closes #2008. Thanks to Willem Eradus.
pull/1698/head
Roger A. Light 5 years ago
parent ae3800ad66
commit 5927778ae5

@ -16,6 +16,7 @@ Broker:
before a role that was attached to the group or client is deleted. before a role that was attached to the group or client is deleted.
Closes #1998. Closes #1998.
- Improve logging in dynsec addGroupRole command. Closes #2005. - Improve logging in dynsec addGroupRole command. Closes #2005.
- Improve logging in dynsec addGroupClient command. Closes #2008.
Client library: Client library:
- Improve documentation around the `_v5()` and non-v5 functions, e.g. - Improve documentation around the `_v5()` and non-v5 functions, e.g.

@ -507,7 +507,7 @@ int dynsec_groups__add_client(const char *username, const char *groupname, int p
HASH_FIND(hh, group->clientlist, username, strlen(username), clientlist); HASH_FIND(hh, group->clientlist, username, strlen(username), clientlist);
if(clientlist != NULL){ if(clientlist != NULL){
/* Client is already in the group */ /* Client is already in the group */
return MOSQ_ERR_SUCCESS; return MOSQ_ERR_ALREADY_EXISTS;
} }
rc = dynsec_clientlist__add(&group->clientlist, client, priority); rc = dynsec_clientlist__add(&group->clientlist, client, priority);
@ -567,6 +567,8 @@ int dynsec_groups__process_add_client(cJSON *j_responses, struct mosquitto *cont
dynsec__command_reply(j_responses, context, "addGroupClient", "Client not found", correlation_data); dynsec__command_reply(j_responses, context, "addGroupClient", "Client not found", correlation_data);
}else if(rc == ERR_GROUP_NOT_FOUND){ }else if(rc == ERR_GROUP_NOT_FOUND){
dynsec__command_reply(j_responses, context, "addGroupClient", "Group not found", correlation_data); dynsec__command_reply(j_responses, context, "addGroupClient", "Group not found", correlation_data);
}else if(rc == MOSQ_ERR_ALREADY_EXISTS){
dynsec__command_reply(j_responses, context, "addGroupClient", "Client is already in this group", correlation_data);
}else{ }else{
dynsec__command_reply(j_responses, context, "addGroupClient", "Internal error", correlation_data); dynsec__command_reply(j_responses, context, "addGroupClient", "Internal error", correlation_data);
} }

@ -26,6 +26,7 @@ Version 2.0.5 of Mosquitto has been released. This is a bugfix release.
before a role that was attached to the group or client is deleted. before a role that was attached to the group or client is deleted.
Closes [#1998]. Closes [#1998].
- Improve logging in dynsec addGroupRole command. Closes [#2005]. - Improve logging in dynsec addGroupRole command. Closes [#2005].
- Improve logging in dynsec addGroupClient command. Closes [#2008].
# Client library # Client library
- Improve documentation around the `_v5()` and non-v5 functions, e.g. - Improve documentation around the `_v5()` and non-v5 functions, e.g.
@ -52,3 +53,4 @@ Version 2.0.5 of Mosquitto has been released. This is a bugfix release.
[#1998]: https://github.com/eclipse/mosquitto/issues/1998 [#1998]: https://github.com/eclipse/mosquitto/issues/1998
[#1999]: https://github.com/eclipse/mosquitto/issues/1999 [#1999]: https://github.com/eclipse/mosquitto/issues/1999
[#2005]: https://github.com/eclipse/mosquitto/issues/2005 [#2005]: https://github.com/eclipse/mosquitto/issues/2005
[#2008]: https://github.com/eclipse/mosquitto/issues/2008

Loading…
Cancel
Save