Disallow properties that are invalid for a command.

This commit is contained in:
Roger A. Light 2018-11-01 11:59:59 +00:00
parent 741a8a9cc3
commit 49a8642986

View File

@ -85,6 +85,11 @@ int cfg_parse_property(struct mosq_config *cfg, int argc, char *argv[], int *idx
return MOSQ_ERR_INVAL;
}
if(mosquitto_property_command_check(cmd, identifier)){
fprintf(stderr, "Error: %s property not allow for %s in --property argument.\n\n", propname, cmdname);
return MOSQ_ERR_INVAL;
}
if(identifier == MQTT_PROP_USER_PROPERTY){
if((*idx)+3 > argc-1){
/* Not enough args */