Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cosmetic issues -- 1 #2005

Closed
willem4ever opened this issue Jan 10, 2021 · 1 comment
Closed

Cosmetic issues -- 1 #2005

willem4ever opened this issue Jan 10, 2021 · 1 comment
Milestone

Comments

@willem4ever
Copy link

int dynsec_groups__process_add_role(cJSON *j_responses, struct mosquitto *context, cJSON *command, char *correlation_data)
.
.
	mosquitto_log_printf(MOSQ_LOG_INFO, "dynsec: %s/%s | addGroupRole | groupname=%s | rolename=%s | priority=%d",
			admin_clientid, admin_username, groupname, rolename, 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;
	}
.
.
}
  1. mosquitto_log_printf should called after dynsec_rolelist__group_add so it will not be called when the group_add fails (like other functions)
  2. dynsec_rolelist__group_add(group, role, priority) != MOSQ_ERR_SUCCESS - should check for other possible return codes, now it returns an internal error on e.g. 'MOSQ_ERR_ALREADY_EXISTS'
@ralight
Copy link
Contributor

ralight commented Jan 10, 2021

Thanks Willem, they are good points.

@ralight ralight added this to the 2.0.5 milestone Jan 10, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants