dynsec: Reply with error on add role fail.

pull/1921/head
Roger A. Light 5 years ago
parent 13bdd255a1
commit 692fa5537d

@ -1058,7 +1058,10 @@ int dynsec_clients__process_add_role(cJSON *j_responses, struct mosquitto *conte
return MOSQ_ERR_SUCCESS; return MOSQ_ERR_SUCCESS;
} }
dynsec_rolelist__client_add(client, role, priority); if(dynsec_rolelist__client_add(client, role, priority) != MOSQ_ERR_SUCCESS){
dynsec__command_reply(j_responses, context, "addClientRole", "Internal error", correlation_data);
return MOSQ_ERR_UNKNOWN;
}
dynsec__config_save(); dynsec__config_save();
dynsec__command_reply(j_responses, context, "addClientRole", NULL, correlation_data); dynsec__command_reply(j_responses, context, "addClientRole", NULL, correlation_data);

@ -151,7 +151,10 @@ int dynsec_groups__process_add_role(cJSON *j_responses, struct mosquitto *contex
mosquitto_log_printf(MOSQ_LOG_INFO, "dynsec: %s/%s | addGroupRole | groupname=%s | rolename=%s | priority=%d", mosquitto_log_printf(MOSQ_LOG_INFO, "dynsec: %s/%s | addGroupRole | groupname=%s | rolename=%s | priority=%d",
admin_clientid, admin_username, groupname, rolename, priority); admin_clientid, admin_username, groupname, rolename, priority);
dynsec_rolelist__group_add(group, role, priority); if(dynsec_rolelist__group_add(group, role, priority) != MOSQ_ERR_SUCCESS){
dynsec__command_reply(j_responses, context, "addGroupRole", "Internal error", correlation_data);
return MOSQ_ERR_UNKNOWN;
}
dynsec__config_save(); dynsec__config_save();
dynsec__command_reply(j_responses, context, "addGroupRole", NULL, correlation_data); dynsec__command_reply(j_responses, context, "addGroupRole", NULL, correlation_data);

Loading…
Cancel
Save