dynsec: Return group not found on getGroup.
This commit is contained in:
parent
ad8cf9fc03
commit
c303c67461
@ -778,6 +778,10 @@ int dynsec_groups__process_get(cJSON *j_responses, struct mosquitto *context, cJ
|
||||
return MOSQ_ERR_NOMEM;
|
||||
}
|
||||
cJSON_AddItemToObject(j_data, "group", j_group);
|
||||
}else{
|
||||
cJSON_Delete(tree);
|
||||
dynsec__command_reply(j_responses, context, "getGroup", "Group not found", correlation_data);
|
||||
return MOSQ_ERR_NOMEM;
|
||||
}
|
||||
|
||||
cJSON_AddItemToArray(j_responses, tree);
|
||||
|
@ -258,6 +258,10 @@ get_group2_response = {'responses': [{'command': 'getGroup', 'error': 'Invalid/m
|
||||
#get_group3_command = { 'commands': [{'command': 'getGroup', 'groupname':5}] }
|
||||
#get_group3_response = {'responses': [{'command': 'getGroup', 'error': 'Invalid/missing groupname'}]}
|
||||
|
||||
# Group not found
|
||||
get_group4_command = { 'commands': [{'command': 'getGroup', 'groupname':"missing"}] }
|
||||
get_group4_response = {'responses': [{'command': 'getGroup', 'error': 'Group not found'}]}
|
||||
|
||||
# ==========================================================================
|
||||
# Set anon group
|
||||
# ==========================================================================
|
||||
@ -396,6 +400,7 @@ try:
|
||||
command_check(sock, get_group1_command, get_group1_response, "1")
|
||||
command_check(sock, get_group2_command, get_group2_response, "2")
|
||||
#command_check(sock, get_group3_command, get_group3_response, "3")
|
||||
command_check(sock, get_group4_command, get_group4_response, "4")
|
||||
|
||||
command_check(sock, set_anon_group1_command, set_anon_group1_response, "1")
|
||||
command_check(sock, set_anon_group2_command, set_anon_group2_response, "2")
|
||||
|
Loading…
Reference in New Issue
Block a user